sign in user after confirmation

This commit is contained in:
Stella 2014-11-30 20:06:12 +02:00 committed by Stella Rouzi
parent 343bdec617
commit 31df114ce4
2 changed files with 13 additions and 1 deletions

View 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

View file

@ -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