Fix error when token invalid (#20972)

## Before

<img width="914" height="519" alt="image"
src="https://github.com/user-attachments/assets/8933bf9e-d8db-4670-ad08-69e900083fc1"
/>

## After

<img width="1105" height="523" alt="image"
src="https://github.com/user-attachments/assets/d8638dbb-adee-4b7d-9d29-1a2a0185ab4f"
/>
This commit is contained in:
martmull
2026-05-27 18:30:14 +02:00
committed by GitHub
parent 46e7f23df1
commit fbae66de8a
2 changed files with 6 additions and 3 deletions
@@ -137,7 +137,10 @@ export class JwtWrapperService {
const payload = this.decode<JwtPayload>(token, { json: true });
if (!isDefined(payload)) {
throw new AuthException('No payload', AuthExceptionCode.UNAUTHENTICATED);
throw new AuthException(
'Token invalid.',
AuthExceptionCode.UNAUTHENTICATED,
);
}
const { key, algorithm } = await this.resolveVerificationKey(token);