Add PortraitUrl to User
This commit is contained in:
@@ -7,8 +7,15 @@ namespace Hutopy.Infrastructure.Utils;
|
||||
|
||||
public static class JwtTokenHelper
|
||||
{
|
||||
public static string GenerateJwtToken(string issuer, string audience, string key, string? userId, string? email,
|
||||
string? firstname, string? lastname, string? portraitUrl)
|
||||
public static string GenerateJwtToken(
|
||||
string issuer,
|
||||
string audience,
|
||||
string key,
|
||||
string? userId,
|
||||
string? email,
|
||||
string? firstname,
|
||||
string? lastname,
|
||||
string? portraitUrl)
|
||||
{
|
||||
var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key));
|
||||
var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);
|
||||
@@ -19,7 +26,8 @@ public static class JwtTokenHelper
|
||||
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||
new Claim(ClaimTypes.NameIdentifier, userId),
|
||||
new Claim(ClaimTypes.Email, email),
|
||||
new Claim(ClaimTypes.GivenName, firstname),
|
||||
new Claim(ClaimTypes.Name, email),
|
||||
new Claim(ClaimTypes.GivenName, firstname),
|
||||
new Claim(ClaimTypes.Surname, lastname),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user