mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Move Infrastructure.Jwt into Features.Users (#287)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace Features.Users.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Service for generating and validating JSON Web Tokens (JWTs) used for authentication.
|
||||
/// </summary>
|
||||
public interface ITokenInfrastructure
|
||||
{
|
||||
/// <summary>
|
||||
/// Generates a signed JWT for the given user.
|
||||
/// </summary>
|
||||
string GenerateJwt(Guid userId, string username, DateTime expiry, string secret);
|
||||
|
||||
/// <exception cref="Domain.Exceptions.UnauthorizedException">Thrown when the token is invalid, expired, or fails validation.</exception>
|
||||
Task<ClaimsPrincipal> ValidateJwtAsync(string token, string secret);
|
||||
}
|
||||
Reference in New Issue
Block a user