This commit is contained in:
Kallesh B S 2025-09-26 09:17:20 +05:30
parent 5cc654d0d8
commit af71715fd6

View File

@ -153,12 +153,15 @@ export class AuthService {
// Validate the response shape // Validate the response shape
if (!data?.keys || !Array.isArray(data.keys)) { if (!data?.keys || !Array.isArray(data.keys)) {
console.log("failed to get pub keys");
throw new UnauthorizedException('Authentication failed'); throw new UnauthorizedException('Authentication failed');
} }
// Find the key with the matching kid // Find the key with the matching kid
const key = data.keys.find((k) => k.kid === kid); const key = data.keys.find((k) => k.kid === kid);
if (!key) { if (!key) {
console.log("failed to get pub key from keys");
throw new UnauthorizedException('Authentication failed'); throw new UnauthorizedException('Authentication failed');
} }