示例#1
0
        public async Task <AuthResult> LogoutAsync(LogoutData logoutData)
        {
            var validatedToken = _jwtManager.GetPrincipalFromToken(logoutData.Token);

            if (validatedToken == null)
            {
                return(AuthResult.CreateWithSingleError("Invalid token format."));
            }

            await _jwtManager.RevokeTokenAsync(validatedToken);

            return(new AuthResult
            {
                Success = true
            });
        }