How prevent a user log in twice with the same username - using Rails Authlogic?
Asked
Active
Viewed 474 times
1 Answers
0
You mean Avoid multiple sessions ?

Community
- 1
- 1

Damien MATHIEU
- 31,924
- 13
- 86
- 94
-
That looks like it, but what is "record"? When I implement that piece of code I get: "The error occurred while evaluating nil.reset_persistence_token" Thank, Michal. – jokinn Feb 18 '10 at 12:53
-
This code needs to be added to the UserSession model. Not the User one. The "record" represents the user that's trying to log himself in. – Damien MATHIEU Feb 18 '10 at 15:23
-
It is in UserSession, exactly how instructed, and it is nil. – jokinn Feb 18 '10 at 15:54
-
Do you have the last version of authlogic ? – Damien MATHIEU Feb 18 '10 at 16:40
-
I do have the latest version indeed, I don't understand why it doesn't work :( – jokinn Feb 22 '10 at 09:48
-
OK, so it seems that record is only nil, when an automatic logout happens (a user session timeout). – jokinn Feb 25 '10 at 10:01