diff options
author | crupest <crupest@outlook.com> | 2021-04-28 17:16:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-28 17:16:45 +0800 |
commit | 76ea7c9f7295f1507bc87154b36cc0f2ea22036e (patch) | |
tree | ed6e2b0e7dcad128bf9b971e74c233d23113e284 /BackEnd/Timeline/Services/Token | |
parent | 344d189e5860a20ebe42cec03b86974a2a3aaa95 (diff) | |
download | timeline-76ea7c9f7295f1507bc87154b36cc0f2ea22036e.tar.gz timeline-76ea7c9f7295f1507bc87154b36cc0f2ea22036e.tar.bz2 timeline-76ea7c9f7295f1507bc87154b36cc0f2ea22036e.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Services/Token')
-rw-r--r-- | BackEnd/Timeline/Services/Token/IUserTokenManager.cs | 4 | ||||
-rw-r--r-- | BackEnd/Timeline/Services/Token/UserTokenManager.cs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/BackEnd/Timeline/Services/Token/IUserTokenManager.cs b/BackEnd/Timeline/Services/Token/IUserTokenManager.cs index c6eaa5b7..bdc1add3 100644 --- a/BackEnd/Timeline/Services/Token/IUserTokenManager.cs +++ b/BackEnd/Timeline/Services/Token/IUserTokenManager.cs @@ -18,7 +18,7 @@ namespace Timeline.Services.Token /// <exception cref="ArgumentException">Thrown when <paramref name="username"/> is of bad format.</exception>
/// <exception cref="UserNotExistException">Thrown when the user with <paramref name="username"/> does not exist.</exception>
/// <exception cref="BadPasswordException">Thrown when <paramref name="password"/> is wrong.</exception>
- public Task<UserTokenCreateResult> CreateToken(string username, string password, DateTime? expireAt = null);
+ public Task<UserTokenCreateResult> CreateTokenAsync(string username, string password, DateTime? expireAt = null);
/// <summary>
/// Verify a token and get the saved user info. This also check the database for existence of the user.
@@ -30,6 +30,6 @@ namespace Timeline.Services.Token /// <exception cref="UserTokenVersionExpiredException">Thrown when the token is of bad version.</exception>
/// <exception cref="UserTokenBadFormatException">Thrown when the token is of bad format.</exception>
/// <exception cref="UserTokenUserNotExistException">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<UserEntity> VerifyToken(string token);
+ public Task<UserEntity> VerifyTokenAsync(string token);
}
}
diff --git a/BackEnd/Timeline/Services/Token/UserTokenManager.cs b/BackEnd/Timeline/Services/Token/UserTokenManager.cs index 1d5348a5..5aa85a5e 100644 --- a/BackEnd/Timeline/Services/Token/UserTokenManager.cs +++ b/BackEnd/Timeline/Services/Token/UserTokenManager.cs @@ -26,7 +26,7 @@ namespace Timeline.Services.Token _clock = clock;
}
- public async Task<UserTokenCreateResult> CreateToken(string username, string password, DateTime? expireAt = null)
+ public async Task<UserTokenCreateResult> CreateTokenAsync(string username, string password, DateTime? expireAt = null)
{
expireAt = expireAt?.MyToUtc();
@@ -51,7 +51,7 @@ namespace Timeline.Services.Token }
- public async Task<UserEntity> VerifyToken(string token)
+ public async Task<UserEntity> VerifyTokenAsync(string token)
{
if (token == null)
throw new ArgumentNullException(nameof(token));
|