chore: add user get profile and check validity route
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import { JwtModuleAsyncOptions } from "@nestjs/jwt";
|
||||
|
||||
export function jwtConfig(): JwtModuleAsyncOptions {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService) => ({
|
||||
secret: configService.getOrThrow<string>("JWT_SECRET_KEY"),
|
||||
}),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { ThrottlerStorageRedisService } from "@nest-lab/throttler-storage-redis";
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import { ThrottlerAsyncOptions } from "@nestjs/throttler";
|
||||
|
||||
import { AuthMessage } from "../common/enums/message.enum";
|
||||
|
||||
export function rateLimitConfig(): ThrottlerAsyncOptions {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService) => ({
|
||||
throttlers: [
|
||||
{
|
||||
ttl: configService.getOrThrow("THROTTLE_TTL"),
|
||||
limit: configService.getOrThrow("THROTTLE_LIMIT"),
|
||||
},
|
||||
],
|
||||
errorMessage: AuthMessage.TOO_MANY_REQUESTS,
|
||||
storage: new ThrottlerStorageRedisService(configService.getOrThrow("REDIS_URI")),
|
||||
}),
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
|
||||
export function SmsConfigs() {
|
||||
export function smsConfigs() {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory(configService: ConfigService) {
|
||||
|
||||
@@ -5,6 +5,17 @@ export function getSwaggerDocument(app: NestFastifyApplication) {
|
||||
const swaggerConfig = new DocumentBuilder()
|
||||
.setTitle("The Danak dsc api document")
|
||||
.setDescription("The Danak dsc API description")
|
||||
.addBearerAuth(
|
||||
{
|
||||
type: "http",
|
||||
scheme: "bearer",
|
||||
bearerFormat: "JWT",
|
||||
name: "authorization",
|
||||
in: "header",
|
||||
},
|
||||
"authorization",
|
||||
)
|
||||
|
||||
.setVersion("1.0.0")
|
||||
.build();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import { TypeOrmModuleAsyncOptions } from "@nestjs/typeorm";
|
||||
|
||||
export function DatabaseConfigs(): TypeOrmModuleAsyncOptions {
|
||||
export function databaseConfigs(): TypeOrmModuleAsyncOptions {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory(configService: ConfigService) {
|
||||
|
||||
Reference in New Issue
Block a user