Commit 9e12138a authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Automatic local auth provider assignment

when a valid user with empty authentication providers list tries to
log in
parent 4d1021bd
......@@ -102,6 +102,11 @@ def login(request, on_failure='im/login.html'):
message = msg + msg_extra
elif not user.can_login_with_auth_provider('local'):
# valid user logged in with no auth providers set, add local provider
# and let him log in
if user.auth_providers.count() == 0:
user.add_auth_provider('local')
else:
message = _(astakos_messages.NO_LOCAL_AUTH)
if message:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment