Commit a69a59e5 authored by Drew Blessing's avatar Drew Blessing

Merge branch 'cat-time-precision-2fa-ldap' into 'master'

Update the 2FA user check to use timestamps

See merge request gitlab-org/gitlab!41327
parents 8463cf91 ebb99365
......@@ -129,6 +129,10 @@ module AuthenticatesWithTwoFactor
def user_changed?(user)
return false unless session[:user_updated_at]
user.updated_at != session[:user_updated_at]
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/244638
# Rounding errors happen when the user is updated, as the Rails ActiveRecord
# object has higher precision than what is stored in the database, therefore
# using .to_i to force truncation to the timestamp
user.updated_at.to_i != session[:user_updated_at].to_i
end
end
---
title: Update the 2FA user update check to account for rounding errors
merge_request: 41327
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment