From c5402c208adeb7a494860e0a041378d00094b6c4 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Tue, 26 Nov 2024 15:48:08 +0330 Subject: [PATCH 1/2] Add rf6 folders to gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b69de81..ce40df7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,10 @@ /src/project-reading # /src/rpgf5-data-import /src/ai-summary +/src/ai-summary-rf5 +/src/rf6-pw-ranking +/src/rf6-data-import + # Envs From e641a788929de6f9f17641e7212e2264a53db5b7 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Mon, 2 Dec 2024 15:30:02 +0330 Subject: [PATCH 2/2] Changes for easy demo rf5 --- .gitignore | 1 + src/auth/auth.controller.ts | 17 +++++++---------- src/auth/auth.service.ts | 11 ++++++----- src/auth/dto/login.dto.ts | 8 ++++---- tsconfig.json | 5 ++++- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index ce40df7..d7b0e9e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /src/ai-summary-rf5 /src/rf6-pw-ranking /src/rf6-data-import +/git-ignored-archive # Envs diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index fbcaccb..8d73c4c 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -60,17 +60,14 @@ export class AuthController { @ApiResponse({ status: 200, description: 'Sets an auth cookie' }) @Post('/login') - async login( - @Res() res: Response, - @Body() { message, signature, address }: LoginDTO, - ) { + async login(@Res() res: Response, @Body() { address }: LoginDTO) { let isNewUser = false; - const isAuthentic = await this.authService.verifyUser( - message, - signature as `0x${string}`, - address as `0x${string}`, - ); - if (!isAuthentic) throw new UnauthorizedException('Invalid signature'); + // const isAuthentic = await this.authService.verifyUser( + // message, + // signature as `0x${string}`, + // address as `0x${string}`, + // ); + // if (!isAuthentic) throw new UnauthorizedException('Invalid signature'); let user = await this.prismaService.user.findFirst({ where: { address }, diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index cc0262e..26e434e 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -147,11 +147,12 @@ export class AuthService { ) => { try { // await this.isNonceValid(message.nonce); - const valid = await verifyMessage({ - address, - message, - signature, - }); + // const valid = await verifyMessage({ + // address, + // message, + // signature, + // }); + const valid = true; return valid; } catch (err) { return false; diff --git a/src/auth/dto/login.dto.ts b/src/auth/dto/login.dto.ts index 3af92e9..d220ca0 100644 --- a/src/auth/dto/login.dto.ts +++ b/src/auth/dto/login.dto.ts @@ -77,11 +77,11 @@ export class SiweMessageClass { } export class LoginDTO { - @ApiProperty() - message: string; + // @ApiProperty() + // message: string; - @ApiProperty() - signature: string; + // @ApiProperty() + // signature: string; @ApiProperty() address: string; diff --git a/tsconfig.json b/tsconfig.json index ae1e156..f824660 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,8 @@ "incremental": true, "skipLibCheck": true, "noFallthroughCasesInSwitch": false - } + }, + "include": [ + "src/**/*" + ] }