Skip to content

Commit 0dc11fc

Browse files
authored
Update AuthController.cs
Re-enabled other Auth methods
1 parent 33e5511 commit 0dc11fc

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/Features/Authentication/AuthController.cs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,36 @@ public AuthController(
4343
_tokenManager = tokenManager ?? throw new ArgumentNullException(nameof(tokenManager));
4444
}
4545

46-
// [HttpPost("/api/_auth/signin")]
47-
// public async Task<IActionResult> SignIn([FromBody] SignInBodyRequest body, CancellationToken cancellationToken)
48-
// {
49-
// var found = await _authService.SendSignInEmailAsync(body.Email.Trim(), cancellationToken);
50-
51-
// if (!found)
52-
// return NotFound(new { });
53-
54-
// return Ok(new { });
55-
// }
56-
57-
// [HttpPost("/api/_auth/register")]
58-
// [EnableRateLimiting("SignUp")]
59-
// public async Task<IActionResult> Register([FromBody] RegisterBodyRequest body, CancellationToken cancellationToken)
60-
// {
61-
// await _authService.SendRegisterEmailAsync(body.Name.Trim(), body.Email.Trim(), cancellationToken);
62-
// return Ok(new { });
63-
// }
64-
65-
// [HttpGet("/api/_auth/github")]
66-
// public IActionResult GitHub()
67-
// {
68-
// return Challenge(new AuthenticationProperties { RedirectUri = $"{_env.SelfBaseUrl}/" }, "github");
69-
// }
70-
71-
// [HttpGet("/api/_auth/google")]
72-
// public IActionResult Google()
73-
// {
74-
// return Challenge(new AuthenticationProperties { RedirectUri = $"{_env.SelfBaseUrl}/" }, "google");
75-
// }
46+
[HttpPost("/api/_auth/signin")]
47+
public async Task<IActionResult> SignIn([FromBody] SignInBodyRequest body, CancellationToken cancellationToken)
48+
{
49+
var found = await _authService.SendSignInEmailAsync(body.Email.Trim(), cancellationToken);
50+
51+
if (!found)
52+
return NotFound(new { });
53+
54+
return Ok(new { });
55+
}
56+
57+
[HttpPost("/api/_auth/register")]
58+
[EnableRateLimiting("SignUp")]
59+
public async Task<IActionResult> Register([FromBody] RegisterBodyRequest body, CancellationToken cancellationToken)
60+
{
61+
await _authService.SendRegisterEmailAsync(body.Name.Trim(), body.Email.Trim(), cancellationToken);
62+
return Ok(new { });
63+
}
64+
65+
[HttpGet("/api/_auth/github")]
66+
public IActionResult GitHub()
67+
{
68+
return Challenge(new AuthenticationProperties { RedirectUri = $"{_env.SelfBaseUrl}/" }, "github");
69+
}
70+
71+
[HttpGet("/api/_auth/google")]
72+
public IActionResult Google()
73+
{
74+
return Challenge(new AuthenticationProperties { RedirectUri = $"{_env.SelfBaseUrl}/" }, "google");
75+
}
7676

7777
[HttpGet("/api/_auth/authentik")]
7878
public IActionResult Authentik()

0 commit comments

Comments
 (0)