auth_fc: provision user's informations on registration (#72358)

This commit is contained in:
Benjamin Dauvergne 2022-12-13 16:44:23 +01:00
parent 5dddd1c674
commit 9e7e6dcfba
2 changed files with 2 additions and 1 deletions

View File

@ -491,6 +491,7 @@ class LoginOrLinkView(View):
user.delete()
raise
else:
self.update_user_info(user, user_info)
if created:
logger.info('auth_fc: new account "%s" created with FranceConnect sub "%s"', user, sub)
hooks.call_hooks('event', name='fc-create', user=user, sub=sub, request=request)

View File

@ -126,7 +126,7 @@ def test_create(settings, app, franceconnect, hooks, service, mailoutbox):
assert len(mailoutbox) == 1
assert mailoutbox[0].subject == 'Account creation using FranceConnect'
for body in (mailoutbox[0].body, mailoutbox[0].alternatives[0][0]):
assert 'Hi john.doe@example.com,' in body
assert 'Hi Ÿuñe Frédérique,' in body
assert 'You have just created an account using FranceConnect.' in body
assert 'https://testserver/login/' in body