BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7b879bb8
Commit
7b879bb8
authored
May 23, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump secret key length to 32
parent
e73ea126
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
two_factor_auths_controller.rb
app/controllers/profiles/two_factor_auths_controller.rb
+1
-1
two_factor_auths_controller_spec.rb
.../controllers/profiles/two_factor_auths_controller_spec.rb
+1
-1
factories.rb
spec/factories.rb
+1
-1
No files found.
app/controllers/profiles/two_factor_auths_controller.rb
View file @
7b879bb8
class
Profiles
::
TwoFactorAuthsController
<
Profiles
::
ApplicationController
def
new
unless
current_user
.
otp_secret
current_user
.
otp_secret
=
User
.
generate_otp_secret
(
16
)
current_user
.
otp_secret
=
User
.
generate_otp_secret
(
32
)
current_user
.
save!
end
...
...
spec/controllers/profiles/two_factor_auths_controller_spec.rb
View file @
7b879bb8
...
...
@@ -12,7 +12,7 @@ describe Profiles::TwoFactorAuthsController do
let
(
:user
)
{
create
(
:user
)
}
it
'generates otp_secret for user'
do
expect
(
User
).
to
receive
(
:generate_otp_secret
).
with
(
16
).
and_return
(
'secret'
).
once
expect
(
User
).
to
receive
(
:generate_otp_secret
).
with
(
32
).
and_return
(
'secret'
).
once
get
:new
get
:new
# Second hit shouldn't re-generate it
...
...
spec/factories.rb
View file @
7b879bb8
...
...
@@ -31,7 +31,7 @@ FactoryGirl.define do
trait
:two_factor
do
before
(
:create
)
do
|
user
|
user
.
otp_required_for_login
=
true
user
.
otp_secret
=
User
.
generate_otp_secret
(
16
)
user
.
otp_secret
=
User
.
generate_otp_secret
(
32
)
end
end
...
...
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