0001-fix-login-based-on-the-FC-email-only-fixes-20611.patch
src/authentic2_auth_fc/views.py | ||
---|---|---|
403 | 403 |
token=self.token) |
404 | 404 |
else: |
405 | 405 |
self.logger.warning(u'account with email %s already linked to another sub ' |
406 |
u'%s', |
|
406 |
u'%s, linking is forbidden',
|
|
407 | 407 |
email, user.fc_accounts.values_list('sub', flat=True)) |
408 |
# we log the user using the email method as we did not really authenticate |
|
409 |
# him using FC and we did not update its profile |
|
410 |
self.logger.info(u'logged in using fc email "%s" and reconciliation with ' |
|
411 |
u'an existing account', email) |
|
412 |
messages.warning(request, |
|
413 |
_('We could not link your account to you current ' |
|
414 |
'FranceConnect account, as your account is ' |
|
415 |
'already linked to another FranceConnect account, ' |
|
416 |
'please first unlink your account and retry')) |
|
417 |
a2_utils.simulate_authentication(request, user, 'email') |
|
418 |
return self.redirect(request) |
|
408 | 419 |
if user: |
409 | 420 |
a2_utils.login(request, user, 'france-connect') |
410 | 421 |
self.fc_account = models.FcAccount.objects.get(sub=self.sub, user=user) |
411 |
- |