jbittel/django-mama-cas

Allow services to decide if a request should be warned (`warn_user`)

stsewd opened this issue · 0 comments

stsewd commented

Currently, warning a user before redirecting it to another service is done by a global setting

if getattr(settings, 'MAMA_CAS_ALLOW_AUTH_WARN', False):
self.fields['warn'] = forms.BooleanField(
widget=forms.CheckboxInput(),
label=_("Warn before automatic login to other services"),
required=False)

Would be great if this behavior could be customized by a service backend

class SettingsBackend(object):

and similar to #112, have access to the current user, so the warning can be made taking into consideration the user and the service.