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