File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 55using System . Security . Cryptography ;
66using System . Threading . Tasks ;
77using System . IdentityModel . Tokens . Jwt ;
8- using System . Security . Claims ;
98using System . Text ;
109
1110using JWT ;
@@ -123,6 +122,8 @@ public LoginResult LoginSymmetric(User user)
123122 tokenResult . TokenType = "Jwt" ;
124123
125124 var payload = Payload ( ) ;
125+ payload . Add ( new System . Security . Claims . Claim ( "user_id" , user . UserID . ToString ( ) , ClaimValueTypes . Integer ) ) ;
126+
126127 var key = new SymmetricSecurityKey ( Encoding . UTF8 . GetBytes ( _config [ "JWT:Secret" ] ) ) ;
127128 var signIn = new SigningCredentials ( key , SecurityAlgorithms . HmacSha256 ) ;
128129 var token = new JwtSecurityToken (
@@ -171,7 +172,7 @@ public bool IsTokenValid(string scope, string accessToken)
171172 return result ;
172173 }
173174
174- public Token ? DecodeToken ( string accessToken )
175+ public Token DecodeToken ( string accessToken )
175176 {
176177 var rsaParams = GetRSAPublic ( _publicKey ) ;
177178 Token tok = null ;
You can’t perform that action at this time.
0 commit comments