mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 03:26:17 +00:00
Update AppImage
This commit is contained in:
@@ -137,18 +137,20 @@ def get_auth_status():
|
|||||||
Get current authentication status
|
Get current authentication status
|
||||||
Returns dict with:
|
Returns dict with:
|
||||||
{
|
{
|
||||||
"enabled": bool,
|
"auth_enabled": bool,
|
||||||
"configured": bool,
|
"auth_configured": bool,
|
||||||
"declined": bool,
|
"declined": bool,
|
||||||
"username": str or None
|
"username": str or None,
|
||||||
|
"authenticated": bool
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
config = load_auth_config()
|
config = load_auth_config()
|
||||||
return {
|
return {
|
||||||
"enabled": config.get("enabled", False),
|
"auth_enabled": config.get("enabled", False),
|
||||||
"configured": config.get("configured", False),
|
"auth_configured": config.get("configured", False), # Frontend expects this field name
|
||||||
"declined": config.get("declined", False),
|
"declined": config.get("declined", False),
|
||||||
"username": config.get("username") if config.get("enabled") else None
|
"username": config.get("username") if config.get("enabled") else None,
|
||||||
|
"authenticated": False # Will be set to True by the route handler if token is valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ def auth_status():
|
|||||||
"""Get current authentication status"""
|
"""Get current authentication status"""
|
||||||
try:
|
try:
|
||||||
status = auth_manager.get_auth_status()
|
status = auth_manager.get_auth_status()
|
||||||
|
|
||||||
|
token = request.headers.get('Authorization', '').replace('Bearer ', '')
|
||||||
|
if token:
|
||||||
|
username = auth_manager.verify_token(token)
|
||||||
|
if username:
|
||||||
|
status['authenticated'] = True
|
||||||
|
|
||||||
return jsonify(status)
|
return jsonify(status)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({"error": str(e)}), 500
|
return jsonify({"error": str(e)}), 500
|
||||||
|
|||||||
Reference in New Issue
Block a user