Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Refresh Token in Custom Interceptor #191

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

GODrums
Copy link
Collaborator

@GODrums GODrums commented Nov 27, 2024

Preview Deployment

This PR has a Preview-Deployment for testing: https://pr191.hephaestus.felixdietrich.com/

Motivation

Follow-up on #190. Tokens previously did not get refreshed correctly when minimizing or losing the focus of the tab.

Description

This PR changes how access tokens are refreshed: the HTTP Interceptor now checks if the access token has to get refreshed before a request to the Spring Boot-server is made.

Official docs: https://angular.dev/guide/http/interceptors#modifying-requests

Testing Instructions

  • Run application-server and webapp Use the Preview Deployment
  • Login on the website
  • Wait for the access token to expire (exact time can be checked via the dev tools, should be 300s)
  • Make a new request, e.g. a different leaderboard, and check for failure

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally
  • Screenshots have been attached (if applicable)
  • Documentation has been updated (if applicable)

@GODrums GODrums added bug Something isn't working priority:critical Urgent tasks needing immediate resolution. labels Nov 27, 2024
@GODrums GODrums self-assigned this Nov 27, 2024
@github-actions github-actions bot added client size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 27, 2024
Copy link
Collaborator

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Thank you for the help with this, really great job :)

@FelixTJDietrich FelixTJDietrich merged commit ff7bf9a into develop Nov 27, 2024
5 checks passed
@FelixTJDietrich FelixTJDietrich deleted the fix/token-refresh-interval branch November 27, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client priority:critical Urgent tasks needing immediate resolution. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants