fix: WS reconnection deadlock, remove redundant try/except, fix docs
- websocket.js: schedule reconnect backoff when token refresh fails, otherwise WebSocket stays dead after 3+ disconnects with failed refresh - daemon/handlers/auth.py: remove two redundant try/except ValueError: raise blocks in webauthn register/authenticate finish handlers - docs/api.md: mark permissions as optional in Create User endpoint
This commit is contained in:
+5
-11
@@ -409,13 +409,10 @@ def webauthn_register_finish(_request: Any, body: Any) -> dict[str, Any]:
|
||||
"username, credential_response, and registration_options are required"
|
||||
)
|
||||
|
||||
try:
|
||||
cred = verify_registration(
|
||||
username, credential_response, registration_options, credential_name
|
||||
)
|
||||
return {"ok": True, "credential": cred}
|
||||
except ValueError:
|
||||
raise
|
||||
cred = verify_registration(
|
||||
username, credential_response, registration_options, credential_name
|
||||
)
|
||||
return {"ok": True, "credential": cred}
|
||||
|
||||
|
||||
@registry.register(POST_AUTH_WEBAUTHN_AUTHENTICATE_BEGIN)
|
||||
@@ -458,10 +455,7 @@ def webauthn_authenticate_finish(_request: Any, body: Any) -> dict[str, Any]:
|
||||
if not check_webauthn_rate(username, client_ip):
|
||||
raise ValueError("Too many WebAuthn attempts. Please try again later.")
|
||||
|
||||
try:
|
||||
verify_authentication(username, assertion_response, auth_options)
|
||||
except ValueError:
|
||||
raise
|
||||
verify_authentication(username, assertion_response, auth_options)
|
||||
|
||||
user = get_user(username)
|
||||
if user is None:
|
||||
|
||||
Reference in New Issue
Block a user