using System.Security.Claims;
using Yuna.Website.Server.Infrastructure;
using Yuna.Website.Server.Model;

namespace Yuna.Website.Server.Services.TokenService
{
    public class TokenService : ITokenService
    {
        //private readonly UserKeeperService _userKeeperService;
        private readonly ILogger<TokenService> _logger;
        public TokenService(ILogger<TokenService> logger)
        {
            _logger = logger;
        }

        public ClaimsIdentity CreateAccessToken(User user)
        {
            var claims = new List<Claim>()
            {
                new(ClaimTypes.Name, user.UserName),
                new(ClaimTypes.NameIdentifier, user.Id.ToString()),
                new(ClaimTypes.Role, user.IsAdmin.ToString())
            };

            return new ClaimsIdentity(claims, "Cookies");
        }
    }
}
