0.1.21 • Published 1 year ago

@guteres/nest-auth-module v0.1.21

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Installation

!!!! Only for GraphQL !!!!

Config

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)