0.1.21 • Published 1 year ago
@guteres/nest-auth-module v0.1.21
Installation
!!!! Only for GraphQL !!!!
Config
- Install MongooseModule
- Install GraphQLModule
Add this to app.module.ts and rename database "SET-YOUR-DB"
imports: [
MongooseModule.forRoot('mongodb://localhost/[SET-YOUR-DB]'),
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
autoSchemaFile: 'schema.gql',
sortSchema: true,
debug: true,
playground: true,
}),
AuthModule.register({ secret: 'own', expiresIn: '100m' }),
],
Guards
@UseGuards(JwtAuthGuard)