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

Error: Unknown authentication strategy "jwt-refresh" #2

Open
SergioJuniorCE opened this issue Dec 22, 2021 · 3 comments
Open

Error: Unknown authentication strategy "jwt-refresh" #2

SergioJuniorCE opened this issue Dec 22, 2021 · 3 comments

Comments

@SergioJuniorCE
Copy link

I was following the tutorial as close as possible, I even have the exact same code

import { AuthGuard } from '@nestjs/passport';

export class RefreshTokenGuard extends AuthGuard('jwt-refresh') {
  constructor() {
    super();
  }
}

this is the error that I get

[Nest] 11492  - 21/12/2021, 11:45:25 pm   ERROR [ExceptionsHandler] Unknown authentication strategy "jwt-refresh"
Error: Unknown authentication strategy "jwt-refresh"
    at attempt (D:\dev\alejandria\jwt-test\node_modules\passport\lib\middleware\authenticate.js:193:39)
    at authenticate (D:\dev\alejandria\jwt-test\node_modules\passport\lib\middleware\authenticate.js:370:7)
    at D:\dev\alejandria\jwt-test\node_modules\@nestjs\passport\dist\auth.guard.js:91:3
    at new Promise (<anonymous>)
    at D:\dev\alejandria\jwt-test\node_modules\@nestjs\passport\dist\auth.guard.js:83:83
    at RefreshTokenGuard.<anonymous> (D:\dev\alejandria\jwt-test\node_modules\@nestjs\passport\dist\auth.guard.js:49:36)
    at Generator.next (<anonymous>)
    at fulfilled (D:\dev\alejandria\jwt-test\node_modules\@nestjs\passport\dist\auth.guard.js:17:58)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
@vladwulf
Copy link
Owner

vladwulf commented Jan 6, 2022

Have you provided the jwt-refresh strategy in the auth module providers array?

@dtrokhlib
Copy link

@vladwulf thanks, that is exact problem I have run into, everything works well with added strategy to providers )

@lilianQ-Q
Copy link

What about closing this issue ?

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

No branches or pull requests

4 participants