Фикс
Some checks failed
Create and publish a Docker image / Deploy image (push) Blocked by required conditions
Create and publish a Docker image / Publish image (push) Has been cancelled

This commit is contained in:
Sergey Karmanov 2023-12-24 05:27:32 +03:00
parent ac987781fa
commit 48732a751b
Signed by: serega404
GPG Key ID: B6AD49C8C835460C
2 changed files with 6 additions and 2 deletions

View File

@ -148,7 +148,7 @@ public class UsersController : ControllerBase
[HttpGet("signin-google")] [HttpGet("signin-google")]
public IActionResult SignInWithGoogle() 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); return Challenge(properties, GoogleDefaults.AuthenticationScheme);
} }

View File

@ -8,6 +8,8 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using Microsoft.AspNetCore.Authentication.Google; using Microsoft.AspNetCore.Authentication.Google;
using Microsoft.AspNetCore.Authentication.OAuth;
using Microsoft.AspNetCore.Authentication.Cookies;
TypeAdapterConfig<PutMeetingDto, Meeting>.NewConfig().Map(d => d.SpeackerImage, s => s.SpeackerImage.JoinFileNames()); TypeAdapterConfig<PutMeetingDto, Meeting>.NewConfig().Map(d => d.SpeackerImage, s => s.SpeackerImage.JoinFileNames());
@ -45,9 +47,11 @@ builder.Services.AddAuthentication(opt => {
}) })
.AddGoogle(options => .AddGoogle(options =>
{ {
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.CallbackPath = "/api/users/signin-google";
options.ClientId = builder.Configuration["Google:ClientId"]!; options.ClientId = builder.Configuration["Google:ClientId"]!;
options.ClientSecret = builder.Configuration["Google:ClientSecret"]!; options.ClientSecret = builder.Configuration["Google:ClientSecret"]!;
});; });