@@ -130,8 +130,11 class User < Principal | |||||
130 |
|
130 | |||
131 | # Returns the user that matches provided login and password, or nil |
|
131 | # Returns the user that matches provided login and password, or nil | |
132 | def self.try_to_login(login, password) |
|
132 | def self.try_to_login(login, password) | |
|
133 | login = login.to_s | |||
|
134 | password = password.to_s | |||
|
135 | ||||
133 | # Make sure no one can sign in with an empty password |
|
136 | # Make sure no one can sign in with an empty password | |
134 |
return nil if password. |
|
137 | return nil if password.empty? | |
135 | user = find_by_login(login) |
|
138 | user = find_by_login(login) | |
136 | if user |
|
139 | if user | |
137 | # user is already in local database |
|
140 | # user is already in local database |
General Comments 0
You need to be logged in to leave comments.
Login now