diff --git a/example/src/WebEid.AspNetCore.Example/Controllers/Api/AuthController.cs b/example/src/WebEid.AspNetCore.Example/Controllers/Api/AuthController.cs index e208f52..bd1430d 100644 --- a/example/src/WebEid.AspNetCore.Example/Controllers/Api/AuthController.cs +++ b/example/src/WebEid.AspNetCore.Example/Controllers/Api/AuthController.cs @@ -55,10 +55,14 @@ public async Task Login([FromBody] AuthenticateRequestDto dto) await SignInUser(dto.AuthToken); return Ok(); } - catch (Exception ex) when (ex is InvalidOperationException or ChallengeNonceNotFoundException or ChallengeNonceExpiredException) + catch (Exception ex) when (ex is ChallengeNonceNotFoundException or ChallengeNonceExpiredException) { return Unauthorized(new { error = "challenge_nonce_not_found_or_expired" }); } + catch (AuthTokenException) + { + return Unauthorized(new { error = "authentication_failed" }); + } } [HttpPost("logout")]