Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ebb99365
Commit
ebb99365
authored
Sep 03, 2020
by
Catalin Irimie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the 2FA user check to use timestamps
parent
ba8e93fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
app/controllers/concerns/authenticates_with_two_factor.rb
app/controllers/concerns/authenticates_with_two_factor.rb
+5
-1
changelogs/unreleased/cat-time-precision-2fa-ldap.yml
changelogs/unreleased/cat-time-precision-2fa-ldap.yml
+5
-0
No files found.
app/controllers/concerns/authenticates_with_two_factor.rb
View file @
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
changelogs/unreleased/cat-time-precision-2fa-ldap.yml
0 → 100644
View file @
ebb99365
---
title
:
Update the 2FA user update check to account for rounding errors
merge_request
:
41327
author
:
type
:
fixed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment