NestJs REST API with MongoDB #4 - Authentication, Login/Sign Up, assign JWT and more

NestJs REST API with MongoDB #4 - Authentication, Login/Sign Up, assign JWT and more

Coding With Abbas

1 год назад

32,440 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Aliyan Ashraf
Aliyan Ashraf - 13.10.2023 18:51

For those getting error:
nest can't resolve dependencies of the JWT_MODULE_OPTIONS (?). Please make sure that the argument ConfigService at index [0] is available in the JwtModule context.

solution:
add
imports: [ConfigModule], inside JWTModule.RegisterAsync


Thank you.

Ответить
Awara Amin
Awara Amin - 05.10.2023 09:27

The fourth one is great too!

Ответить
Fajar Fathurisky
Fajar Fathurisky - 24.09.2023 10:42

Thanks Sir, you save my life,
But any of my class-validator is not working, I use class-validator in dto as you did
Is there is something that I miss?

Ответить
AG Shorts
AG Shorts - 01.07.2023 13:21

Error: Nest can't resolve dependencies of the JWT_MODULE_OPTIONS (?). Please make sure that the argument ConfigService at index [0] is available in the JwtModule context.

Potential solutions:
- Is JwtModule a valid NestJS module?
- If ConfigService is a provider, is it part of the current JwtModule?
- If ConfigService is exported from a separate @Module, is that module imported within JwtModule?
@Module({
imports: [ /* the Module containing ConfigService */ ]
})

at Injector.lookupComponentInParentModules (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\injector.js:248:19)
at Injector.resolveComponentInstance (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\injector.js:202:33)
at resolveParam (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\injector.js:123:38)
at async Promise.all (index 0)
at Injector.resolveConstructorParams (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\injector.js:138:27)
at Injector.loadInstance (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\injector.js:64:13)
at Injector.loadProvider (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\injector.js:91:9)
at E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\instance-loader.js:56:13
at async Promise.all (index 4)
at InstanceLoader.createInstancesOfProviders (E:\bytescrum\react\backend\node_modules\@nestjs\core\injector\instance-loader.js:55:9)
PS E:\bytescrum\react\backend> $ npm install --save @nestjs/jwt
$ : The term '$' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ $ npm install --save @nestjs/jwt
+ ~
+ CategoryInfo : ObjectNotFound: ($:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS E:\bytescrum\react\backend> npm install --save @nestjs/jwt
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
[##################] | reify:fsevents: sill reify mark deleted [ 'E:\\bytescrum\\react\\backend\\node_modules\\fsevents' ]

Ответить
Dũng Đặng Văn
Dũng Đặng Văn - 30.06.2023 09:23

thanks you so much

Ответить
Shashank Kamath
Shashank Kamath - 21.06.2023 09:14

Thanks for this video , also I want to know what all extra videos are there in your udemy course on nest js?

Ответить
Shamil Vk
Shamil Vk - 14.06.2023 14:25

throwing error

Ответить
VvManikanta Kantipudi
VvManikanta Kantipudi - 09.06.2023 15:03

secretOrPrivateKey must have a value i am getting this error please help to resolve this

Ответить
Ahmet Keles
Ahmet Keles - 02.06.2023 02:38

It doesnt give me any errors if i write mail or password incorrect just instantly gives me token even if i send the inputs empty, and i cant see the users that created in mongo can you help me please?

Ответить
Parash Ukheda
Parash Ukheda - 29.05.2023 10:26

sir please can u tell me where are u import Jwt Service in auth.service.ts

Ответить
vaibhav singh
vaibhav singh - 30.04.2023 09:49

I'm getting error:
Error: Nest can't resolve dependencies of the JWT_MODULE_OPTIONS (?). Please make sure that the argument ConfigService at index [0] is available in the JwtModule context.

Ответить
aditi mohan
aditi mohan - 14.04.2023 11:10

I don't have .env file in my project . Is there any alternate solution

Ответить
ashish kumari
ashish kumari - 02.03.2023 15:11

Thank you sir

Ответить
ashish kumari
ashish kumari - 01.03.2023 15:03

sir,
latest version of mongoose is giving errors

Ответить
Jimmy Adams
Jimmy Adams - 01.03.2023 06:43

how to make a swagger api for login and singup and in it use nestjs and mongodb please help me

Ответить
girish pillai
girish pillai - 15.02.2023 18:37

why have you created a get api for login it should be post

Ответить