From 4aadb05cd5718c7d16bf432c96e23ae4e7db4783 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 21 Jan 2020 01:11:17 +0800 Subject: ... --- Timeline/Controllers/TokenController.cs | 6 +++--- Timeline/Controllers/UserController.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Timeline/Controllers') diff --git a/Timeline/Controllers/TokenController.cs b/Timeline/Controllers/TokenController.cs index 67001e87..851c7606 100644 --- a/Timeline/Controllers/TokenController.cs +++ b/Timeline/Controllers/TokenController.cs @@ -94,16 +94,16 @@ namespace Timeline.Controllers User = result }); } - catch (JwtVerifyException e) + catch (JwtUserTokenBadFormatException e) { - if (e.ErrorCode == JwtVerifyException.ErrorCodes.Expired) + if (e.ErrorCode == JwtUserTokenBadFormatException.ErrorCodes.Expired) { var innerException = e.InnerException as SecurityTokenExpiredException; LogFailure(LogVerifyExpire, e, ("Expires", innerException?.Expires), ("Current Time", _clock.GetCurrentTime())); return BadRequest(ErrorResponse.TokenController.Verify_TimeExpired()); } - else if (e.ErrorCode == JwtVerifyException.ErrorCodes.OldVersion) + else if (e.ErrorCode == JwtUserTokenBadFormatException.ErrorCodes.OldVersion) { var innerException = e.InnerException as JwtBadVersionException; LogFailure(LogVerifyOldVersion, e, diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs index 956865dc..65ee3a0f 100644 --- a/Timeline/Controllers/UserController.cs +++ b/Timeline/Controllers/UserController.cs @@ -27,15 +27,15 @@ namespace Timeline.Controllers } [HttpGet("users"), AdminAuthorize] - public async Task> List() + public async Task> List() { return Ok(await _userService.ListUsers()); } [HttpGet("users/{username}"), AdminAuthorize] - public async Task> Get([FromRoute][Username] string username) + public async Task> Get([FromRoute][Username] string username) { - var user = await _userService.GetUser(username); + var user = await _userService.GetUserByUsername(username); if (user == null) { _logger.LogInformation(Log.Format(LogGetUserNotExist, ("Username", username))); -- cgit v1.2.3