Skip to content

Commit

Permalink
fix: slow csl links issue
Browse files Browse the repository at this point in the history
closes #1663
  • Loading branch information
Dev Srivastava authored and Dev Srivastava committed May 13, 2024
1 parent 3553638 commit be3270d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion intranet/apps/cslapps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ def redirect_to_app(request):
return response
return redirect(app.url)
else:
last_token = AccessToken.objects.filter(user=request.user, application=app.oauth_application).order_by("-expires").first()
last_token = (
AccessToken.objects.filter(user=request.user, application=app.oauth_application)
.order_by("-expires")
.values_list("token", "expires")
.first()
)
if last_token and last_token.is_valid():
return redirect(app.url)
return redirect(app.auth_url)
Expand Down

0 comments on commit be3270d

Please sign in to comment.