summaryrefslogtreecommitdiffstats
path: root/src/server/Api/Internal/Account
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Api/Internal/Account')
-rw-r--r--src/server/Api/Internal/Account/CreateGithubSessionRoute.cs17
1 files changed, 17 insertions, 0 deletions
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);
+ }
+}