summaryrefslogtreecommitdiffstats
path: root/server/src/Endpoints/Internal/Account/CreateGithubSessionRoute.cs
blob: 0cd1aa59ce4b49ca964792392e16d02deb38f0a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using AspNet.Security.OAuth.GitHub;

namespace IOL.GreatOffice.Api.Endpoints.Internal.Account;

public class CreateGithubSessionRoute : RouteBaseSync.WithRequest<string>.WithActionResult
{
	public CreateGithubSessionRoute(IConfiguration configuration) { }

	[AllowAnonymous]
	[HttpGet("~/_/account/create-github-session")]
	public override ActionResult Handle(string next) {
		return Challenge(new AuthenticationProperties {
								 RedirectUri = next
						 },
						 GitHubAuthenticationDefaults.AuthenticationScheme);
	}
}