Skip to content

Conversation

@Brad123ghost
Copy link
Contributor

Changes

  • Add ability to refresh access token given a refresh token is active and correct
  • Rename token in auth-context to accessToken

Misc

  • Add argon2 to hash JWT token as bcrypt limits to 72 chars
  • Updated unit test to reflect changes

Notes
The default access token time is 15 minutes with the refresh token being 1 day, if changing this make sure to update the unit test as well.
Given the renaming of token, the frontend will need to be updated to reflect these changes.

Changes:
- Added ability to refresh access token.
- Argon in place of bcrypt for JWT hashing
- Updated unit test
@vercel
Copy link

vercel bot commented Oct 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
speed-app ✅ Ready (Inspect) Visit Preview Oct 17, 2024 2:31pm
speed-app-backend ✅ Ready (Inspect) Visit Preview Oct 17, 2024 2:31pm

@Brad123ghost Brad123ghost linked an issue Oct 17, 2024 that may be closed by this pull request
Copy link
Owner

@jackdar jackdar left a comment

Choose a reason for hiding this comment

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

Error I'm getting when attempting to run backend:

[Nest] 63421  - 10/22/2024, 6:29:12 PM   ERROR [ExceptionHandler] JwtStrategy requires a secret or key
TypeError: JwtStrategy requires a secret or key
    at new JwtStrategy (/Users/jackdarlington/Developer/speed-app/backend/node_modules/passport-jwt/lib/strategy.js:45:15)
    at new MixinStrategy (/Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:32:13)
    at new RefreshStrategy (/Users/jackdarlington/Developer/speed-app/backend/src/auth/refresh-token.strategy.ts:15:5)
    at Injector.instantiateClass (/Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/core/injector/injector.js:365:19)
    at callback (/Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/core/injector/injector.js:65:45)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Injector.resolveConstructorParams (/Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/core/injector/injector.js:144:24)
    at async Injector.loadInstance (/Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/core/injector/injector.js:70:13)
    at async Injector.loadProvider (/Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/core/injector/injector.js:97:9)
    at async /Users/jackdarlington/Developer/speed-app/backend/node_modules/@nestjs/core/injector/instance-loader.js:56:13

Base automatically changed from development to main October 22, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

help needed with token refresh

3 participants