auth: Improve JsonableError in get_..._jwt_authentication_request.

This commit is contained in:
Mateusz Mandera
2023-01-29 23:57:09 +01:00
committed by Tim Abbott
parent 6c638a1057
commit c9c255b3a8
2 changed files with 4 additions and 2 deletions

View File

@@ -483,7 +483,7 @@ def get_email_and_realm_from_jwt_authentication_request(
key = settings.JWT_AUTH_KEYS[realm.subdomain]["key"]
algorithms = settings.JWT_AUTH_KEYS[realm.subdomain]["algorithms"]
except KeyError:
raise JsonableError(_("Auth key for this subdomain not found"))
raise JsonableError(_("JWT authentication is not enabled for this organization"))
try:
json_web_token = request.POST["json_web_token"]