diff options
author | crupest <crupest@outlook.com> | 2021-01-07 16:36:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-07 16:36:57 +0800 |
commit | 5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d (patch) | |
tree | c483a2fff48ad952e787e5af1bb541d939a09f19 /BackEnd/Timeline/Services/UserTokenManager.cs | |
parent | 20e9136a9f27a0b77f076ea5997b71d89ce3cfca (diff) | |
parent | df1ef1e21d8d889a2c9abd440039533c6a43818f (diff) | |
download | timeline-5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d.tar.gz timeline-5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d.tar.bz2 timeline-5ad1b1f0191ee1131e7808c8fcb0484ba29c0d4d.zip |
Merge pull request #198 from crupest/back-dev
Refactor back end.
Diffstat (limited to 'BackEnd/Timeline/Services/UserTokenManager.cs')
-rw-r--r-- | BackEnd/Timeline/Services/UserTokenManager.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/BackEnd/Timeline/Services/UserTokenManager.cs b/BackEnd/Timeline/Services/UserTokenManager.cs index b887b987..4e24c922 100644 --- a/BackEnd/Timeline/Services/UserTokenManager.cs +++ b/BackEnd/Timeline/Services/UserTokenManager.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
+using Timeline.Entities;
using Timeline.Helpers;
using Timeline.Models;
using Timeline.Services.Exceptions;
@@ -10,7 +11,7 @@ namespace Timeline.Services public class UserTokenCreateResult
{
public string Token { get; set; } = default!;
- public UserInfo User { get; set; } = default!;
+ public UserEntity User { get; set; } = default!;
}
public interface IUserTokenManager
@@ -38,7 +39,7 @@ namespace Timeline.Services /// <exception cref="UserTokenBadVersionException">Thrown when the token is of bad version.</exception>
/// <exception cref="UserTokenBadFormatException">Thrown when the token is of bad format.</exception>
/// <exception cref="UserNotExistException">Thrown when the user specified by the token does not exist. Usually the user had been deleted after the token was issued.</exception>
- public Task<UserInfo> VerifyToken(string token);
+ public Task<UserEntity> VerifyToken(string token);
}
public class UserTokenManager : IUserTokenManager
@@ -75,7 +76,7 @@ namespace Timeline.Services }
- public async Task<UserInfo> VerifyToken(string token)
+ public async Task<UserEntity> VerifyToken(string token)
{
if (token == null)
throw new ArgumentNullException(nameof(token));
|