Allow auth providers to influence is_active (#15557)
* Allow auth providers to influence is_active * Fix auth script test
This commit is contained in:
1 parent
a42288d056
commit
2fcacbff23
11 files changed
+82
-23
No files matched your search
@@ -75,14 +75,16 @@ class ExampleAuthProvider(AuthProvider):
|
||||
Will be used to populate info when creating a new user.
|
||||
"""
|
||||
username = credentials.data['username']
|
||||
info = {
|
||||
'is_active': True,
|
||||
}
|
||||
|
||||
for user in self.config['users']:
|
||||
if user['username'] == username:
|
||||
return {
|
||||
'name': user.get('name')
|
||||
}
|
||||
info['name'] = user.get('name')
|
||||
break
|
||||
|
||||
return {}
|
||||
return info
|
||||
|
||||
|
||||
class LoginFlow(data_entry_flow.FlowHandler):
|
||||
|
||||
Reference in new issue
Block a user