Skip to content

Commit

Permalink
Merge pull request #71 from GeneralMagicio/rf6-easy-demo
Browse files Browse the repository at this point in the history
Rf6 easy demo
  • Loading branch information
mmahdigh authored Dec 2, 2024
2 parents 877e93b + e641a78 commit 02142ee
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
/src/project-reading
# /src/rpgf5-data-import
/src/ai-summary
/src/ai-summary-rf5
/src/rf6-pw-ranking
/src/rf6-data-import
/git-ignored-archive


# Envs

Expand Down
17 changes: 7 additions & 10 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
11 changes: 6 additions & 5 deletions src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/auth/dto/login.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"incremental": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": false
}
},
"include": [
"src/**/*"
]
}

0 comments on commit 02142ee

Please sign in to comment.