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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
c03d39df
Commit
c03d39df
authored
Oct 12, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove tokens:reset_all_auth rake task
parent
cd3b4ba4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
17 deletions
+1
-17
lib/tasks/tokens.rake
lib/tasks/tokens.rake
+1
-11
spec/tasks/tokens_spec.rb
spec/tasks/tokens_spec.rb
+0
-6
No files found.
lib/tasks/tokens.rake
View file @
c03d39df
require_relative
'../../app/models/concerns/token_authenticatable.rb'
namespace
:tokens
do
desc
"Reset all GitLab user auth tokens"
task
reset_all_auth: :environment
do
reset_all_users_token
(
:reset_authentication_token!
)
end
desc
"Reset all GitLab email tokens"
desc
"Reset all GitLab incoming email tokens"
task
reset_all_email: :environment
do
reset_all_users_token
(
:reset_incoming_email_token!
)
end
...
...
@@ -31,11 +26,6 @@ class TmpUser < ActiveRecord::Base
self
.
table_name
=
'users'
def
reset_authentication_token!
write_new_token
(
:authentication_token
)
save!
(
validate:
false
)
end
def
reset_incoming_email_token!
write_new_token
(
:incoming_email_token
)
save!
(
validate:
false
)
...
...
spec/tasks/tokens_spec.rb
View file @
c03d39df
...
...
@@ -7,12 +7,6 @@ describe 'tokens rake tasks' do
Rake
.
application
.
rake_require
'tasks/tokens'
end
describe
'reset_all task'
do
it
'invokes create_hooks task'
do
expect
{
run_rake_task
(
'tokens:reset_all_auth'
)
}.
to
change
{
user
.
reload
.
authentication_token
}
end
end
describe
'reset_all_email task'
do
it
'invokes create_hooks task'
do
expect
{
run_rake_task
(
'tokens:reset_all_email'
)
}.
to
change
{
user
.
reload
.
incoming_email_token
}
...
...
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