using Google.Authenticator;

namespace e_suite.Modules.UserManager.Facade;

public class TwoFactorAuthenticatorFacade : ITwoFactorAuthenticator
{
    private readonly TwoFactorAuthenticator _twoFactorAuthenticator;
    
    public TwoFactorAuthenticatorFacade()
    {
        _twoFactorAuthenticator = new TwoFactorAuthenticator();
    }

    public bool ValidateTwoFactorPIN(string authenticationKey, string securityCode, bool secretIsBase32 = false)
    {
        return _twoFactorAuthenticator.ValidateTwoFactorPIN(authenticationKey, securityCode, secretIsBase32);
    }

    public SetupCode GenerateSetupCode(string issuer, string accountTitleNoSpaces, string accountSecretKey, bool secretIsBase32, int qaPixelsPerModule = 3 )
    {
        return _twoFactorAuthenticator.GenerateSetupCode(issuer, accountTitleNoSpaces, accountSecretKey, secretIsBase32, qaPixelsPerModule);
    }
}