From d7e4d41434e542a4730d461fc9d911005e35ff94 Mon Sep 17 00:00:00 2001 From: Sergey Karmanov Date: Sun, 24 Dec 2023 05:27:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CyberBoom/Controllers/UserController.cs | 2 +- CyberBoom/Program.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CyberBoom/Controllers/UserController.cs b/CyberBoom/Controllers/UserController.cs index 771cd20..6e50583 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 = "https://cyberbloom.zetcraft.ru/api/users/signin-google-callback" }; return Challenge(properties, GoogleDefaults.AuthenticationScheme); } diff --git a/CyberBoom/Program.cs b/CyberBoom/Program.cs index 2751d19..7417109 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()); @@ -47,6 +48,8 @@ builder.Services.AddAuthentication(opt => { { options.ClientId = builder.Configuration["Google:ClientId"]!; options.ClientSecret = builder.Configuration["Google:ClientSecret"]!; + options.CallbackPath = new PathString("https://cyberbloom.zetcraft.ru/api/users/signin-google-callback"); + });;