@@ -167,7 +167,7 class User < Principal | |||||
167 |
|
167 | |||
168 | # Returns the user who matches the given autologin +key+ or nil |
|
168 | # Returns the user who matches the given autologin +key+ or nil | |
169 | def self.try_to_autologin(key) |
|
169 | def self.try_to_autologin(key) | |
170 | tokens = Token.find_all_by_action_and_value('autologin', key) |
|
170 | tokens = Token.find_all_by_action_and_value('autologin', key.to_s) | |
171 | # Make sure there's only 1 token that matches the key |
|
171 | # Make sure there's only 1 token that matches the key | |
172 | if tokens.size == 1 |
|
172 | if tokens.size == 1 | |
173 | token = tokens.first |
|
173 | token = tokens.first | |
@@ -341,12 +341,12 class User < Principal | |||||
341 | end |
|
341 | end | |
342 |
|
342 | |||
343 | def self.find_by_rss_key(key) |
|
343 | def self.find_by_rss_key(key) | |
344 | token = Token.find_by_value(key) |
|
344 | token = Token.find_by_value(key.to_s) | |
345 | token && token.user.active? ? token.user : nil |
|
345 | token && token.user.active? ? token.user : nil | |
346 | end |
|
346 | end | |
347 |
|
347 | |||
348 | def self.find_by_api_key(key) |
|
348 | def self.find_by_api_key(key) | |
349 | token = Token.find_by_action_and_value('api', key) |
|
349 | token = Token.find_by_action_and_value('api', key.to_s) | |
350 | token && token.user.active? ? token.user : nil |
|
350 | token && token.user.active? ? token.user : nil | |
351 | end |
|
351 | end | |
352 |
|
352 |
General Comments 0
You need to be logged in to leave comments.
Login now