Profil: display token only once
This commit is contained in:
parent
bd04972f65
commit
17285b0368
6 changed files with 54 additions and 37 deletions
|
@ -1,13 +1,13 @@
|
|||
module NewAdministrateur
|
||||
class ProfilController < AdministrateurController
|
||||
def show
|
||||
@administrateur = current_administrateur
|
||||
end
|
||||
|
||||
def renew_api_token
|
||||
flash[:notice] = "Votre token d'API a été regénéré."
|
||||
current_administrateur.renew_api_token
|
||||
redirect_to profil_path
|
||||
@token = current_administrateur.api_token
|
||||
flash.now.notice = 'Votre jeton a été regénéré.'
|
||||
render :show
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue