mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
sign in user after confirmation
This commit is contained in:
parent
343bdec617
commit
31df114ce4
2 changed files with 13 additions and 1 deletions
12
app/controllers/confirmations_controller.rb
Normal file
12
app/controllers/confirmations_controller.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
class ConfirmationsController < Devise::ConfirmationsController
|
||||||
|
protected
|
||||||
|
|
||||||
|
def after_confirmation_path_for(resource_name, resource)
|
||||||
|
if signed_in?
|
||||||
|
signed_in_root_path(resource)
|
||||||
|
else
|
||||||
|
sign_in resource
|
||||||
|
root_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -5,7 +5,7 @@ Osem::Application.routes.draw do
|
||||||
else
|
else
|
||||||
devise_for :users,
|
devise_for :users,
|
||||||
controllers: {
|
controllers: {
|
||||||
registrations: :registrations,
|
registrations: :registrations, confirmations: :confirmations,
|
||||||
omniauth_callbacks: 'users/omniauth_callbacks' },
|
omniauth_callbacks: 'users/omniauth_callbacks' },
|
||||||
path: 'accounts'
|
path: 'accounts'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue