Navigation Menu

Skip to content

Commit

Permalink
Put session manipulation back in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardarella committed Jul 28, 2012
1 parent cad265d commit 1e6e5bf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion app/mixins/easy_auth/controllers/password_reset.rb
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/mixins/easy_auth/controllers/sessions.rb
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions app/mixins/easy_auth/models/account.rb
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions app/mixins/easy_auth/models/identity.rb
Expand Up @@ -23,10 +23,6 @@ def authenticate(attributes = nil)
end
end

def set_account_session(session)
account.set_session(session)
end

def remember
@remember
end
Expand Down

0 comments on commit 1e6e5bf

Please sign in to comment.