diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-19 21:37:15 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-19 21:37:15 +0800 |
commit | b00cfa30a4f6a1c6d896d46da7dd063abf632cd3 (patch) | |
tree | e6168234660307247111ee369a0b2123823614eb /Timeline/Controllers/TokenController.cs | |
parent | 2984abc9aa0429380459e5b5b6fda2d20058041b (diff) | |
download | timeline-b00cfa30a4f6a1c6d896d46da7dd063abf632cd3.tar.gz timeline-b00cfa30a4f6a1c6d896d46da7dd063abf632cd3.tar.bz2 timeline-b00cfa30a4f6a1c6d896d46da7dd063abf632cd3.zip |
...
Diffstat (limited to 'Timeline/Controllers/TokenController.cs')
-rw-r--r-- | Timeline/Controllers/TokenController.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Timeline/Controllers/TokenController.cs b/Timeline/Controllers/TokenController.cs index 2e661695..ce5786ca 100644 --- a/Timeline/Controllers/TokenController.cs +++ b/Timeline/Controllers/TokenController.cs @@ -54,7 +54,7 @@ namespace Timeline.Controllers [AllowAnonymous]
public async Task<IActionResult> Create([FromBody] CreateTokenRequest request)
{
- void LogFailure(string reason, Exception e = null)
+ void LogFailure(string reason, Exception? e = null)
{
_logger.LogInformation(e, Log.Format("Attemp to login failed.",
("Reason", reason),
@@ -100,7 +100,7 @@ namespace Timeline.Controllers [AllowAnonymous]
public async Task<IActionResult> Verify([FromBody] VerifyTokenRequest request)
{
- void LogFailure(string reason, Exception e = null, params (string, object)[] otherProperties)
+ void LogFailure(string reason, Exception? e = null, params (string, object?)[] otherProperties)
{
var properties = new (string, object)[2 + otherProperties.Length];
properties[0] = ("Reason", reason);
@@ -125,7 +125,7 @@ namespace Timeline.Controllers {
const string message = "Token is expired.";
var innerException = e.InnerException as SecurityTokenExpiredException;
- LogFailure(message, e, ("Expires", innerException.Expires), ("Current Time", _clock.GetCurrentTime()));
+ LogFailure(message, e, ("Expires", innerException?.Expires), ("Current Time", _clock.GetCurrentTime()));
return BadRequest(new CommonResponse(ErrorCodes.Http.Token.Verify.Expired, message));
}
else
|