Skip to content

Commit

Permalink
[DEV-3513] allow master and signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick1712 committed Jan 4, 2025
1 parent 3a65f01 commit e147165
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/subdomains/generic/user/models/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ export class AuthService {

if (keyWalletId) {
const wallet = await this.walletService.getByIdOrName(keyWalletId);
if (dto.signature !== wallet.masterKey) throw new UnauthorizedException('Invalid credentials');
if (
dto.signature !== wallet.masterKey &&
!(await this.verifySignature(dto.address, dto.signature, isCustodial, dto.key, user.signature))
)
throw new UnauthorizedException('Invalid credentials');
} else if (!(await this.verifySignature(dto.address, dto.signature, isCustodial, dto.key, user.signature))) {
throw new UnauthorizedException('Invalid credentials');
} else if (!user.signature) {
Expand Down

0 comments on commit e147165

Please sign in to comment.