Exemplo n.º 1
0
        public async Task <IActionResult> GetCurrentPin([FromServices] ITwoFactorSetupService service,
                                                        string secretKey,
                                                        CancellationToken cancellationToken = default)
        {
            var result = await service.GetCurrentPin(secretKey);

            return(Ok(result));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Generate(
            [FromServices] ITwoFactorSetupService service,
            CancellationToken cancellationToken = default)
        {
            var result = await service.GenerateTwoFactor();

            return(Ok(result));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Validate(
            [FromServices] ITwoFactorSetupService service,
            string code, string privateKey,
            CancellationToken cancellationToken = default)
        {
            var result = await service.ValidateTwoFactor(privateKey, code);

            return(Ok(result));
        }