beeman‎.‎dev | Add Authentication to a NestJS GraphQL API - Building the BEEHIVE Platform with BEEMAN.DEV - BLS004 @beeman-dev | Uploaded September 2020 | Updated October 2024, 1 hour ago.
In this live stream we will add Authentication to the Beehive Course API that we have build in the previous live streams. The GraphQL API is built in NestJS inside of an Nx Workspace.
I hope this video will help you much. If this video give some value to you then please smash the like button to push me in YouTube algorithms and if you are new to my channel then please subscribe tp stay updated! Thanks
💡 Subscribe to get all updates: 👉bit.ly/3fR8Exo
Feel free to ask any questions in the commands! Also, feel free to share any useful timestamps I can list here!
Timestamps
[0:00] Introduction
[2:10] Create Auth library
[2:40] Create User model
[4:54] Implement AuthResolver
[5:19] Add login/register mutations
[6:00] Add AuthLogin AuthRegister Inputs DTOs
[7:58] Implement AuthService
[10:18] Fix error "Mutation was defined in resolvers, but not schema" and "remember to explicitly provide a return type function"
[11:04] Add UserToken model
[11:58] Fix error "Cannot determine a GraphQL input type for the input"
[13:10] Fix error "Make sure your class is decorated with an appropriate decorator"
[14:14] Implement Register method in AuthService
[19:28] Implement Login method in AuthService
[23:04] Add password hashing and validation with bcryptjs
[27:00] Add JWT strategy with @nestjs/jwt and @nestjs/passport
[35:35] Load JwtModule and JwtService to sign tokens
[38:58] Implement GqlAuthGuard
[42:58] Project mutations with the GqlAuthGuard
[46:59] Create CtxUser decorator to retrieve user info
[53:15] Add relation to define that Author hasMany Course in schema.prisma
[54:30] Fix error "The relation field author uses the scalar fields authorId" "at lest one of those fields is required"
[55:10] Make Author own the Course data using the Prisma Client
[57:18] Retrieve related Author data own the Course data
Pull request: github.com/beeman/beehive/pull/3
Star the repo: github.com/beeman/beehive
In this live stream we will add Authentication to the Beehive Course API that we have build in the previous live streams. The GraphQL API is built in NestJS inside of an Nx Workspace.
I hope this video will help you much. If this video give some value to you then please smash the like button to push me in YouTube algorithms and if you are new to my channel then please subscribe tp stay updated! Thanks
💡 Subscribe to get all updates: 👉bit.ly/3fR8Exo
Feel free to ask any questions in the commands! Also, feel free to share any useful timestamps I can list here!
Timestamps
[0:00] Introduction
[2:10] Create Auth library
[2:40] Create User model
[4:54] Implement AuthResolver
[5:19] Add login/register mutations
[6:00] Add AuthLogin AuthRegister Inputs DTOs
[7:58] Implement AuthService
[10:18] Fix error "Mutation was defined in resolvers, but not schema" and "remember to explicitly provide a return type function"
[11:04] Add UserToken model
[11:58] Fix error "Cannot determine a GraphQL input type for the input"
[13:10] Fix error "Make sure your class is decorated with an appropriate decorator"
[14:14] Implement Register method in AuthService
[19:28] Implement Login method in AuthService
[23:04] Add password hashing and validation with bcryptjs
[27:00] Add JWT strategy with @nestjs/jwt and @nestjs/passport
[35:35] Load JwtModule and JwtService to sign tokens
[38:58] Implement GqlAuthGuard
[42:58] Project mutations with the GqlAuthGuard
[46:59] Create CtxUser decorator to retrieve user info
[53:15] Add relation to define that Author hasMany Course in schema.prisma
[54:30] Fix error "The relation field author uses the scalar fields authorId" "at lest one of those fields is required"
[55:10] Make Author own the Course data using the Prisma Client
[57:18] Retrieve related Author data own the Course data
Pull request: github.com/beeman/beehive/pull/3
Star the repo: github.com/beeman/beehive