aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/TokenController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-01-19 22:45:43 +0800
committercrupest <crupest@outlook.com>2020-01-19 22:45:43 +0800
commite6069a6980ec6d2505e19026d4c84a9588f153dc (patch)
tree1fa3969a53138becb76a7eef7bafdafc7046c12c /Timeline/Controllers/TokenController.cs
parentc5f3c69b3a008ab87542e523e2a59f37801bd65a (diff)
downloadtimeline-e6069a6980ec6d2505e19026d4c84a9588f153dc.tar.gz
timeline-e6069a6980ec6d2505e19026d4c84a9588f153dc.tar.bz2
timeline-e6069a6980ec6d2505e19026d4c84a9588f153dc.zip
Basically finish refactor of error codes.
Diffstat (limited to 'Timeline/Controllers/TokenController.cs')
-rw-r--r--Timeline/Controllers/TokenController.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Timeline/Controllers/TokenController.cs b/Timeline/Controllers/TokenController.cs
index c360a109..67001e87 100644
--- a/Timeline/Controllers/TokenController.cs
+++ b/Timeline/Controllers/TokenController.cs
@@ -99,7 +99,7 @@ namespace Timeline.Controllers
if (e.ErrorCode == JwtVerifyException.ErrorCodes.Expired)
{
var innerException = e.InnerException as SecurityTokenExpiredException;
- LogFailure(LogVerifyExpire, e, ("Expires", innerException.Expires),
+ LogFailure(LogVerifyExpire, e, ("Expires", innerException?.Expires),
("Current Time", _clock.GetCurrentTime()));
return BadRequest(ErrorResponse.TokenController.Verify_TimeExpired());
}
@@ -107,7 +107,7 @@ namespace Timeline.Controllers
{
var innerException = e.InnerException as JwtBadVersionException;
LogFailure(LogVerifyOldVersion, e,
- ("Token Version", innerException.TokenVersion),
+ ("Token Version", innerException?.TokenVersion),
("Required Version", innerException?.RequiredVersion));
return BadRequest(ErrorResponse.TokenController.Verify_OldVersion());
}