Administrateur: do not save api_token in clear text anymore

This commit is contained in:
simon lehericey 2018-09-26 17:22:36 +02:00
parent 16566b46c0
commit 88f7e888c3
3 changed files with 7 additions and 14 deletions

View file

@ -39,7 +39,7 @@ class Administrateur < ApplicationRecord
def renew_api_token
api_token = Administrateur.generate_unique_secure_token
encrypted_token = BCrypt::Password.create(api_token)
update(api_token: api_token, encrypted_token: encrypted_token)
update(encrypted_token: encrypted_token)
api_token
end