Changer signature jwt jey

This commit is contained in:
2026-05-30 12:17:07 +01:00
parent df59a97d4f
commit 2116737987
3 changed files with 3 additions and 3 deletions
@@ -29,7 +29,7 @@ public class LoginEndpoint(UsersRepository usersRepository, AutoMapper.IMapper m
{
string jwtToken = JwtBearer.CreateToken(o =>
{
o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong";
o.SigningKey = "v9!Qx7#Lk2@pZ8$wR6!tN5%uF3&cD9^mH1*eY4";
o.ExpireAt = DateTime.UtcNow.AddDays(15);
o.User.Claims.Add(("Username", user.Username)!);
o.User.Claims.Add(("FullName", user.FirstName + user.Name));
@@ -40,7 +40,7 @@ public class RefreshTokenEndpoint(UsersRepository usersRepository, AutoMapper.IM
string jwtToken = JwtBearer.CreateToken(o =>
{
o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong";
o.SigningKey = "v9!Qx7#Lk2@pZ8$wR6!tN5%uF3&cD9^mH1*eY4";
o.ExpireAt = DateTime.UtcNow.AddDays(15);
o.User.Claims.Add(("Username", user.Username)!);
o.User.Claims.Add(("FullName", user.FirstName + user.Name));
+1 -1
View File
@@ -15,7 +15,7 @@ WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
// On ajoute ici FastEndpoints, un framework REPR et Swagger aux services disponibles dans le projet
builder.Services
.AddAuthenticationJwtBearer(s => s.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong")
.AddAuthenticationJwtBearer(s => s.SigningKey = "v9!Qx7#Lk2@pZ8$wR6!tN5%uF3&cD9^mH1*eY4")
.AddAuthorization()
.AddFastEndpoints()
.AddCors(options =>