From 253c8479b9ae0ba6853a70728d3f6e904e1ac2ba Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 23 Jan 2022 22:28:55 +0100 Subject: feat: WIP: Add option to login in with github --- .../Api/Internal/Account/CreateGithubSessionRoute.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/server/Api/Internal/Account/CreateGithubSessionRoute.cs (limited to 'src/server/Api/Internal/Account/CreateGithubSessionRoute.cs') diff --git a/src/server/Api/Internal/Account/CreateGithubSessionRoute.cs b/src/server/Api/Internal/Account/CreateGithubSessionRoute.cs new file mode 100644 index 0000000..21cfead --- /dev/null +++ b/src/server/Api/Internal/Account/CreateGithubSessionRoute.cs @@ -0,0 +1,17 @@ +using AspNet.Security.OAuth.GitHub; + +namespace IOL.BookmarkThing.Server.Api.Internal.Account; + +public class CreateGithubSessionRoute : RouteBaseInternalSync.WithoutRequest.WithActionResult +{ + [AllowAnonymous] + [ApiVersionNeutral] + [ApiExplorerSettings(IgnoreApi = true)] + [HttpGet("~/v{version:apiVersion}/account/create-github-session")] + public override ActionResult Handle() { + return Challenge(new AuthenticationProperties { + RedirectUri = "/oauth-cb", + }, + GitHubAuthenticationDefaults.AuthenticationScheme); + } +} -- cgit v1.3