AuthService Bug

Habia un bug en el archivo AuthService, _jwtSettings debia llegar como un IOptions para hacer el mapeo de propiedades
This commit is contained in:
Alejandro Sarmiento
2024-02-19 20:18:20 +01:00
parent 70bb3f3248
commit ada60babc1

View File

@@ -3,6 +3,7 @@ using CleanArchitecture.Application.Contracts.Identity;
using CleanArchitecture.Application.Models.Identity;
using CleanArchitecture.Identity.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json.Linq;
using System.IdentityModel.Tokens.Jwt;
@@ -16,11 +17,11 @@ namespace CleanArchitecture.Identity.Services
private readonly UserManager<ApplicationUser> userManager;
private readonly SignInManager<ApplicationUser> signInManager;
private readonly JwtSettings jwtSettings;
public AuthService(UserManager<ApplicationUser> _userManager, SignInManager<ApplicationUser> _signInManager, JwtSettings _jwtSettings)
public AuthService(UserManager<ApplicationUser> _userManager, SignInManager<ApplicationUser> _signInManager, IOptions<JwtSettings> _jwtSettings)
{
userManager = _userManager;
signInManager = _signInManager;
jwtSettings = _jwtSettings;
jwtSettings = _jwtSettings.Value;
}