| | | 1 | | namespace Syki.Back.Features.Identity.GoogleOneTapLogin; |
| | | 2 | | |
| | | 3 | | [ApiController, EnableRateLimiting(RateLimitingConfigs.SensitivePolicy)] |
| | 0 | 4 | | public class GoogleOneTapLoginController(GoogleOneTapLoginService service) : ControllerBase |
| | | 5 | | { |
| | | 6 | | /// <summary> |
| | | 7 | | /// Google One Tap Login 🔓 |
| | | 8 | | /// </summary> |
| | | 9 | | /// <remarks> |
| | | 10 | | /// Realiza login via Google One Tap (ID token). |
| | | 11 | | /// </remarks> |
| | | 12 | | [HttpPost("identity/social-login/google-one-tap")] |
| | | 13 | | [SwaggerResponseExample(200, typeof(ResponseExamples))] |
| | | 14 | | [SwaggerResponseExample(400, typeof(ErrorsExamples))] |
| | | 15 | | public async Task<IActionResult> Login([FromBody] GoogleOneTapLoginIn data) |
| | | 16 | | { |
| | 0 | 17 | | var result = await service.Login(data); |
| | 0 | 18 | | return result.Match<IActionResult>(Ok, BadRequest); |
| | 0 | 19 | | } |
| | | 20 | | } |
| | | 21 | | |
| | | 22 | | internal class RequestExamples : ExamplesProvider<GoogleOneTapLoginIn>; |
| | | 23 | | internal class ResponseExamples : ExamplesProvider<GoogleOneTapLoginOut>; |
| | | 24 | | internal class ErrorsExamples : ErrorExamplesProvider< |
| | | 25 | | GoogleOneTapLoginInvalidToken, |
| | | 26 | | GoogleOneTapLoginDisabled, |
| | | 27 | | SocialLoginEmailNotVerified, |
| | | 28 | | SocialLoginSsoRequired |
| | | 29 | | >; |