Profil: display token only once

This commit is contained in:
simon lehericey 2018-08-24 14:19:44 +02:00
parent bd04972f65
commit 17285b0368
6 changed files with 54 additions and 37 deletions

View file

@ -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