Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

login method #366

Closed
wants to merge 1 commit into from

4 participants

Ilya Levin Ken Ip Noam Ben Ari Ohkubo KOHEI
Ilya Levin

login method returning correct values

Ohkubo KOHEI

if login succeeded, current_user should return valid user

https://github.com/Almaron/sorcery/blob/master/lib/sorcery/controller.rb#L66

Ilya Levin

I am not talking about the current_user returning value. I am talking about login() returning value.

Ken Ip

Still, login calls current_user - which should return the correct value.

Noam Ben Ari
Owner

The current return values are by design and needed.

Noam Ben Ari NoamB closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 2, 2012
  1. Ilya Levin

    login() returning correctly

    Almaron authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/sorcery/controller.rb
3  lib/sorcery/controller.rb
View
@@ -37,9 +37,10 @@ def login(*credentials)
old_session.to_hash.each_pair do |k,v|
session[k.to_sym] = v
end
+ @current_user = user
auto_login(user)
after_login!(user, credentials)
- current_user
+ @current_user
else
after_failed_login!(credentials)
nil
Something went wrong with that request. Please try again.