apps: remplace le calcul du message et du mode d'authentifcation par les nouvelles méthodes dans le hook login

This commit is contained in:
Benjamin Dauvergne 2017-11-24 19:09:06 +01:00
parent cb13e0ca50
commit a46ce2cc09
1 changed files with 4 additions and 15 deletions

View File

@ -503,23 +503,12 @@ class AppConfig(django.apps.AppConfig):
def cut_event_login(self, user, how, service=None, **kwargs):
# log login for current user
if how.startswith('password'):
msg = u'connexion par mot de passe'
method = 'PWD'
elif how == 'france-connect':
msg = u'connexion par FranceConnect'
method = 'FC'
elif how == 'email':
msg = u'connexon à l\'enregistrement ou par récupération de mot de passe'
method = 'PWD'
elif how == 'oidc':
msg = u'connexion'
method = 'AGENT'
elif how == 'switch':
if how == 'switch':
return
else:
msg = u'connexion how:%s' % how
method = self.get_authentication_method(how)
if not method:
method = how.upper()
msg = self.get_authentication_message(how)
if service:
msg += u' pour %s' % service
self.log_action(user, msg)