mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 13:35:44 +08:00
correct the test
This commit is contained in:
parent
c52784f9d2
commit
5346cd3514
@ -74,7 +74,7 @@ class UserAuthToken < ActiveRecord::Base
|
|||||||
if mark_seen && user_token && !user_token.auth_token_seen && user_token.auth_token == token
|
if mark_seen && user_token && !user_token.auth_token_seen && user_token.auth_token == token
|
||||||
# we must protect against concurrency issues here
|
# we must protect against concurrency issues here
|
||||||
changed_rows = UserAuthToken.where(id: user_token.id, auth_token: token).update_all(auth_token_seen: true)
|
changed_rows = UserAuthToken.where(id: user_token.id, auth_token: token).update_all(auth_token_seen: true)
|
||||||
if changed_rows
|
if changed_rows == 1
|
||||||
# not doing a reload so we don't risk loading a rotated token
|
# not doing a reload so we don't risk loading a rotated token
|
||||||
user_token.auth_token_seen = true
|
user_token.auth_token_seen = true
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user