forked from CyberBloom/CyberBloomBackend
Фикс
This commit is contained in:
parent
ac987781fa
commit
5167076340
@ -1,22 +1,14 @@
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.Google;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore.Internal;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using static Consts;
|
||||
|
||||
namespace CyberBoom.Controllers;
|
||||
|
||||
|
||||
|
||||
[ApiController]
|
||||
[Route("/api/[controller]")]
|
||||
public class UsersController : ControllerBase
|
||||
@ -148,7 +140,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" };
|
||||
return Challenge(properties, GoogleDefaults.AuthenticationScheme);
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,6 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Mapster;
|
||||
using static Consts;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.Authorization;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Microsoft.AspNetCore.Authentication.Google;
|
||||
|
||||
@ -47,7 +45,8 @@ builder.Services.AddAuthentication(opt => {
|
||||
{
|
||||
options.ClientId = builder.Configuration["Google:ClientId"]!;
|
||||
options.ClientSecret = builder.Configuration["Google:ClientSecret"]!;
|
||||
});;
|
||||
options.CallbackPath = "https://cyberbloom.zetcraft.ru/api/users/google-sign-in";
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user