Moved back to default redirect uri
This commit is contained in:
@@ -16,7 +16,7 @@ public class Google : EndpointGroupBase
|
||||
await context.ChallengeAsync(GoogleDefaults.AuthenticationScheme,
|
||||
new AuthenticationProperties
|
||||
{
|
||||
RedirectUri = "/o/google/callback",
|
||||
RedirectUri = "/signin-google",
|
||||
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,12 +52,8 @@ builder.Services.AddInfrastructureServices(builder.Configuration);
|
||||
builder.Services.AddWebServices();
|
||||
|
||||
// OAuth
|
||||
builder.Services.AddAuthentication(options =>
|
||||
{
|
||||
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||
options.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme;
|
||||
})
|
||||
.AddCookie(options =>
|
||||
builder.Services.AddAuthentication()
|
||||
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme,options =>
|
||||
{
|
||||
options.Cookie.Name = "Hutopy";
|
||||
options.Cookie.SecurePolicy = builder.Environment.IsDevelopment() ? CookieSecurePolicy.None : CookieSecurePolicy.Always;
|
||||
@@ -70,7 +66,7 @@ builder.Services.AddAuthentication(options =>
|
||||
{
|
||||
options.ClientId = builder.Configuration["Google:ClientId"] ?? throw new ArgumentNullException("The Google ClientId is missing.");
|
||||
options.ClientSecret = builder.Configuration["Google:ClientSecret"] ?? throw new ArgumentNullException("The Google ClientSecret is missing.");
|
||||
options.CallbackPath = "/o/google/callback";
|
||||
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||
options.Events.OnRedirectToAuthorizationEndpoint = context =>
|
||||
{
|
||||
context.Response.Redirect(context.RedirectUri + "&prompt=consent");
|
||||
|
||||
Reference in New Issue
Block a user