misc: add registration redirect URL to whitelist (#47302)

This commit is contained in:
Benjamin Dauvergne 2020-10-03 07:22:08 +02:00
parent e5e560982e
commit dcb4b40b39
2 changed files with 10 additions and 1 deletions

View File

@ -921,6 +921,12 @@ def good_next_url(request, next_url):
for origin in app_settings.A2_REDIRECT_WHITELIST:
if same_origin(next_url, origin):
return True
if app_settings.A2_REGISTRATION_REDIRECT:
origin = app_settings.A2_REGISTRATION_REDIRECT
if isinstance(origin, (tuple, list)):
origin = origin[0]
if same_origin(next_url, origin):
return True
result = hooks.call_hooks_first_result('good_next_url', next_url)
if result is not None:
return result

View File

@ -579,7 +579,10 @@ class UnlinkView(LoggerMixin, FormView):
hooks.call_hooks('event', name='fc-unlink', user=self.request.user)
messages.info(self.request, _('The link with the FranceConnect account has been deleted.'))
links.delete()
return super(UnlinkView, self).form_valid(form)
response = super(UnlinkView, self).form_valid(form)
if app_settings.logout_when_unlink:
response.display_message = False
return response
def get_context_data(self, **kwargs):
context = super(UnlinkView, self).get_context_data(**kwargs)