diff options
| author | crupest <crupest@outlook.com> | 2020-01-29 18:38:41 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2020-01-29 18:38:41 +0800 |
| commit | 401a0c86054711bf5ebdce7d7717c9b59bffc2fa (patch) | |
| tree | dd1cd091ecc2c80943735af4b71b53ef26fc7eee /Timeline/Auth | |
| parent | b6043126fae039c58512f60a576b10925b06df4c (diff) | |
| download | timeline-401a0c86054711bf5ebdce7d7717c9b59bffc2fa.tar.gz timeline-401a0c86054711bf5ebdce7d7717c9b59bffc2fa.tar.bz2 timeline-401a0c86054711bf5ebdce7d7717c9b59bffc2fa.zip | |
...
Diffstat (limited to 'Timeline/Auth')
| -rw-r--r-- | Timeline/Auth/MyAuthenticationHandler.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Timeline/Auth/MyAuthenticationHandler.cs b/Timeline/Auth/MyAuthenticationHandler.cs index 5bae5117..e6b26c4b 100644 --- a/Timeline/Auth/MyAuthenticationHandler.cs +++ b/Timeline/Auth/MyAuthenticationHandler.cs @@ -82,9 +82,9 @@ namespace Timeline.Auth var userInfo = await _userTokenManager.VerifyToken(token);
var identity = new ClaimsIdentity(AuthenticationConstants.Scheme);
- identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, userInfo.Id.ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Integer64));
+ identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, userInfo.Id!.Value.ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Integer64));
identity.AddClaim(new Claim(identity.NameClaimType, userInfo.Username, ClaimValueTypes.String));
- identity.AddClaims(UserRoleConvert.ToArray(userInfo.Administrator).Select(role => new Claim(identity.RoleClaimType, role, ClaimValueTypes.String)));
+ identity.AddClaims(UserRoleConvert.ToArray(userInfo.Administrator!.Value).Select(role => new Claim(identity.RoleClaimType, role, ClaimValueTypes.String)));
var principal = new ClaimsPrincipal();
principal.AddIdentity(identity);
|
