Api Token: encrypt current tokens
This commit is contained in:
parent
8c4f8347ca
commit
84abfa209c
1 changed files with 10 additions and 0 deletions
10
lib/tasks/2018_08_24_encrypt_tokens.rake
Normal file
10
lib/tasks/2018_08_24_encrypt_tokens.rake
Normal file
|
@ -0,0 +1,10 @@
|
|||
namespace :'2018_08_24_encrypt_tokens' do
|
||||
task run: :environment do
|
||||
Administrateur
|
||||
.where
|
||||
.not(api_token: nil)
|
||||
.each do |admin|
|
||||
admin.update(encrypted_token: BCrypt::Password.create(admin.api_token))
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue