Skip to content

Commit

Permalink
fix: allow tokens without expiry date
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna committed Apr 30, 2024
1 parent 93406ca commit e671c10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bd_api/apps/account_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ def authorize(request: HttpRequest) -> Tuple[URI, Token, Domain, Account, Status

# Token must have same domain,
# its expiry date must be in the future, and it must be active.
if token.domain == domain and token.expiry_date > timezone.now() and token.is_active:
return redirect_uri, token, domain, token.user, True
if token.domain == domain and token.is_active:
if not token.expiry_date or token.expiry_date > timezone.now():
return redirect_uri, token, domain, token.user, True

# If it isn't, it returns a 401.
return redirect_uri, token, domain, token.user, False
Expand Down

0 comments on commit e671c10

Please sign in to comment.