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

🐛 [Bug] Backend Unit Tests fail due to expired JWT #6855

Closed
mahula opened this issue Nov 24, 2023 · 1 comment · Fixed by #6864
Closed

🐛 [Bug] Backend Unit Tests fail due to expired JWT #6855

mahula opened this issue Nov 24, 2023 · 1 comment · Fixed by #6864
Assignees
Labels
bug Something isn't working service: backend

Comments

@mahula
Copy link
Contributor

mahula commented Nov 24, 2023

🐛 Bugreport

These Backend Unit Tests fail due to an expired JWT (see this workflow)
in /backend/src/jwt/decode.spec.ts

● decode › given valid JWT › and corresponding user in the database › returns user object without email
● decode › given valid JWT › and corresponding user in the database › sets lastActiveAt
● decode › given valid JWT *** › and corresponding user in the database › updates lastActiveAt for every authenticated request

Reason

The token is expired: https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/backend/src/jwt/decode.spec.ts#L24

Suggested solutions

  • The quick solution is to renew the token.
  • Way better would be to generate a token in the test - else this problem will reoccur
@mahula mahula added bug Something isn't working service: backend labels Nov 24, 2023
@mahula mahula changed the title 🐛 [Bug] Backend Unit Tests faildue to expired JWT 🐛 [Bug] Backend Unit Tests fail due to expired JWT Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working service: backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants