Skip to content
Browse files

Put session manipulation back in controller

  • Loading branch information...
1 parent cad265d commit 1e6e5bf31e7bc0669c7c627ea92431c675de0f3f @bcardarella bcardarella committed
View
3 app/mixins/easy_auth/controllers/password_reset.rb
@@ -40,7 +40,8 @@ def find_identity_from_reset_token
end
def after_successful_password_reset(identity)
- identity.set_account_session(session)
+ session[:session_token] = identity.account.generate_session_token!
+ session[:account_class] = identity.account.class.to_s
identity.update_attribute(:reset_token, nil)
redirect_to after_successful_password_reset_url(identity), :notice => I18n.t('easy_auth.password_reset.update.notice')
end
View
3 app/mixins/easy_auth/controllers/sessions.rb
@@ -5,7 +5,8 @@ def new
def create
if identity = EasyAuth.identity_model.authenticate(params[:identity])
- identity.set_account_session(session)
+ session[:session_token] = identity.account.generate_session_token!
+ session[:account_class] = identity.account.class.to_s
if identity.remember
cookies[:remember_token] = { :value => identity.generate_remember_token!, :expires => identity.remember_time.from_now }
end
View
5 app/mixins/easy_auth/models/account.rb
@@ -35,11 +35,6 @@ def generate_session_token!
self.session_token
end
- def set_session(session)
- session[:session_token] = generate_session_token!
- session[:account_class] = self.class.to_s
- end
-
private
def setup_identity
View
4 app/mixins/easy_auth/models/identity.rb
@@ -23,10 +23,6 @@ def authenticate(attributes = nil)
end
end
- def set_account_session(session)
- account.set_session(session)
- end
-
def remember
@remember
end

0 comments on commit 1e6e5bf

Please sign in to comment.
Something went wrong with that request. Please try again.