From edcad16e3f4249fc0459e7725a5b731a03165770 Mon Sep 17 00:00:00 2001 From: Gsk54 Date: Mon, 16 Jan 2023 17:07:53 +0100 Subject: [PATCH] start authorization module --- src/modules/authorization/authorization.module.ts | 9 +++++++++ .../domain/usecases/validate-authorization.usecase.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/modules/authorization/authorization.module.ts diff --git a/src/modules/authorization/authorization.module.ts b/src/modules/authorization/authorization.module.ts new file mode 100644 index 0000000..91eb2d1 --- /dev/null +++ b/src/modules/authorization/authorization.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CqrsModule } from '@nestjs/cqrs'; +import { DatabaseModule } from '../database/database.module'; + +@Module({ + imports: [DatabaseModule, CqrsModule], + exports: [], +}) +export class AuthorizationModule {} diff --git a/src/modules/authorization/domain/usecases/validate-authorization.usecase.ts b/src/modules/authorization/domain/usecases/validate-authorization.usecase.ts index 237f25a..9857da6 100644 --- a/src/modules/authorization/domain/usecases/validate-authorization.usecase.ts +++ b/src/modules/authorization/domain/usecases/validate-authorization.usecase.ts @@ -4,6 +4,6 @@ import { ValidateAuthorizationQuery } from '../../queries/validate-authorization @QueryHandler(ValidateAuthorizationQuery) export class ValidateAuthenticationUseCase { async execute(validate: ValidateAuthorizationQuery): Promise { - return Promise.resolve(true); + return Promise.resolve(validate.action == 'authorized'); } }