Adds messages api
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using Google.Apis.Oauth2.v2.Data;
|
||||
using System.Security.Claims;
|
||||
using Hutopy.Application.Common.Interfaces;
|
||||
@@ -220,14 +221,20 @@ public class IdentityService(
|
||||
}
|
||||
|
||||
var user = await GetUserByUserNameAsync(userName);
|
||||
|
||||
if (user is null) throw new InvalidOperationException();
|
||||
|
||||
var jwtSection = configuration.GetRequiredSection("Authentication:Jwt");
|
||||
|
||||
|
||||
var token = JwtTokenHelper.GenerateJwtToken(
|
||||
issuer: jwtSection["Issuer"] ?? "",
|
||||
audience: jwtSection["Audience"] ?? "",
|
||||
key: jwtSection["Key"] ?? "",
|
||||
userId: user?.Id ?? "");
|
||||
userId: user.Id,
|
||||
email: user.Email,
|
||||
firstname: user.FirstName,
|
||||
lastname: user.LastName,
|
||||
portraitUrl: user.PortraitUrl);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user