Skip to content

Commit

Permalink
Api: Return a 403 for missing authorization when requesting a JWT token
Browse files Browse the repository at this point in the history
TYPE: Bugfix
  • Loading branch information
Daverball committed Dec 10, 2024
1 parent 13d6a10 commit 7d33b93
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/onegov/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def get_time_restricted_token(
self: AuthEndpoint, request: 'CoreRequest'
) -> dict[str, str]:
try:
if request.authorization is None:
raise HTTPUnauthorized()

return get_token(request)
except Exception as exception:
raise ApiException(exception=exception) from exception

0 comments on commit 7d33b93

Please sign in to comment.