mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
Allow auth providers to influence is_active (#15557)
* Allow auth providers to influence is_active * Fix auth script test
This commit is contained in:
@@ -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