fix 2
This commit is contained in:
parent
5cc654d0d8
commit
af71715fd6
@ -153,12 +153,15 @@ export class AuthService {
|
||||
|
||||
// Validate the response shape
|
||||
if (!data?.keys || !Array.isArray(data.keys)) {
|
||||
console.log("failed to get pub keys");
|
||||
|
||||
throw new UnauthorizedException('Authentication failed');
|
||||
}
|
||||
|
||||
// Find the key with the matching kid
|
||||
const key = data.keys.find((k) => k.kid === kid);
|
||||
if (!key) {
|
||||
console.log("failed to get pub key from keys");
|
||||
throw new UnauthorizedException('Authentication failed');
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user