mirror of
https://github.com/Govor-team/Govor.git
synced 2026-09-20 09:53:12 +00:00
Use Result.ToActionResult in RefreshController
Import the API extensions and replace manual result handling in RefreshController with result.ToActionResult(), removing the inline empty-token check and switch-based error mapping. Also normalize the empty-token error message in UserSessionRefresher from "cannot be empty" to "can't be empty". This centralizes Result -> IActionResult conversion and simplifies the controller logic.
This commit is contained in:
@@ -34,7 +34,7 @@ public class UserSessionRefresher : IUserSessionRefresher
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(refreshToken))
|
||||
{
|
||||
return Result.Failure<RefreshResult>(Error.Failure("Auth.EmptyToken", "Refresh token cannot be empty."));
|
||||
return Result.Failure<RefreshResult>(Error.Failure("Auth.EmptyToken", "Refresh token can't be empty."));
|
||||
}
|
||||
|
||||
var hashedToken = _jwtTokenHasher.HashToken(refreshToken);
|
||||
|
||||
Reference in New Issue
Block a user