mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-12 00:50:18 +08:00
Add the ability to specify additional fields on the user model that can be used for logging in.
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user