Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
birger
users
Commits
39798ca2
Commit
39798ca2
authored
Sep 13, 2018
by
o@immerda.ch
Browse files
2fa after auth
parent
1cce0b2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/sessions_controller.rb
View file @
39798ca2
...
...
@@ -99,20 +99,6 @@ class SessionsController < ApplicationController
@handoff
=
h
end
session
[
:tfa_query
]
=
pre_auth
&&
pre_auth
[
'need_2fa'
]
if
session
[
:tfa_query
]
&&
params
[
:totp
].
present?
&&
params
[
:totp
].
length
==
6
session
[
:tfa_query
]
=
false
end
if
session
[
:tfa_query
]
if
pre_auth
[
'need_2fa'
]
==
'totp'
flash
[
:notice
]
=
nil
session
[
:tfa_query
]
=
true
load_params
return
render
'2fa'
end
end
begin
res
=
if
!
@handoff
&&
params
[
:unlock
]
ApiBackend
::
auth
(
...
...
@@ -166,7 +152,13 @@ class SessionsController < ApplicationController
# successful login
return
end
rescue
ApiBackend
::
ApiError
rescue
ApiBackend
::
ApiError
=>
e
if
e
.
api_msg
==
'missing_2fa'
flash
[
:notice
]
=
nil
session
[
:tfa_query
]
=
true
load_params
return
render
'2fa'
end
end
return
login_failed
end
...
...
Write
Preview
Supports
Markdown
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