Add the ability to specify additional fields on the user model that can be used for logging in.

This commit is contained in:
Matt Wright
2013-10-16 14:00:36 -04:00
parent 80f5fa8dbb
commit 1ae6bc3cf1
9 changed files with 63 additions and 27 deletions
+10
View File
@@ -279,6 +279,16 @@ def get_token_status(token, serializer, max_age=None):
return expired, invalid, user
def get_identity_attributes(app=None):
app = app or current_app
attrs = app.config['SECURITY_USER_IDENTITY_ATTRIBUTES']
try:
attrs = [f.strip() for f in attrs.split(',')]
except AttributeError:
pass
return attrs
@contextmanager
def capture_passwordless_login_requests():
login_requests = []