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