diff --git a/CyberBoom/Controllers/UserController.cs b/CyberBoom/Controllers/UserController.cs index 771cd20..149d5d2 100644 --- a/CyberBoom/Controllers/UserController.cs +++ b/CyberBoom/Controllers/UserController.cs @@ -148,7 +148,7 @@ public class UsersController : ControllerBase [HttpGet("signin-google")] public IActionResult SignInWithGoogle() { - var properties = new AuthenticationProperties { RedirectUri = Url.Action("SignInWithGoogleCallback") }; + var properties = new AuthenticationProperties { RedirectUri = Url.Action(nameof(SignInWithGoogleCallback)) }; return Challenge(properties, GoogleDefaults.AuthenticationScheme); } diff --git a/CyberBoom/Program.cs b/CyberBoom/Program.cs index 2751d19..ea87a8c 100644 --- a/CyberBoom/Program.cs +++ b/CyberBoom/Program.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.OpenApi.Models; using Microsoft.AspNetCore.Authentication.Google; +using Microsoft.AspNetCore.Authentication.OAuth; TypeAdapterConfig.NewConfig().Map(d => d.SpeackerImage, s => s.SpeackerImage.JoinFileNames()); @@ -45,9 +46,10 @@ builder.Services.AddAuthentication(opt => { }) .AddGoogle(options => { + options.CallbackPath = "/api/users/signin-google"; options.ClientId = builder.Configuration["Google:ClientId"]!; options.ClientSecret = builder.Configuration["Google:ClientSecret"]!; -});; +});