mirror of
https://github.com/ChrispyBacon-dev/DockFlare.git
synced 2026-04-28 03:39:32 +00:00
- /auth/users POST route (add user): Now updates current_app.config['OAUTH_AUTHORIZED_USERS'] after saving
- /auth/users/<email> DELETE route (remove user): Now updates current_app.config['OAUTH_AUTHORIZED_USERS'] after saving The authorized users list is now immediately refreshed in memory, so new users can log in without requiring a container restart.
This commit is contained in:
parent
0e0be773f5
commit
77415663db
1 changed files with 8 additions and 0 deletions
|
|
@ -2159,6 +2159,10 @@ def manage_auth_users():
|
|||
if not _save_encrypted_config(config_data, fernet):
|
||||
return jsonify({"error": "failed_to_save_config"}), 500
|
||||
|
||||
current_app.config['OAUTH_AUTHORIZED_USERS'] = [
|
||||
user['email'] for user in config_data.get('authorized_users', [])
|
||||
]
|
||||
|
||||
return jsonify({"status": "success", "message": "User added successfully."})
|
||||
|
||||
@api_v2_bp.route('/auth/users/<user_email>', methods=['DELETE'])
|
||||
|
|
@ -2180,4 +2184,8 @@ def manage_auth_user(user_email):
|
|||
if not _save_encrypted_config(config_data, fernet):
|
||||
return jsonify({"error": "failed_to_save_config"}), 500
|
||||
|
||||
current_app.config['OAUTH_AUTHORIZED_USERS'] = [
|
||||
user['email'] for user in config_data.get('authorized_users', [])
|
||||
]
|
||||
|
||||
return jsonify({"status": "success", "message": "User deleted successfully."})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue