Compare commits
No commits in common. "5bef2b0dbc04f8731bde02810e6fc10710a3ddb7" and "651bd5b82287eb51870bc97fe99566980cd4f082" have entirely different histories.
5bef2b0dbc
...
651bd5b822
@ -58,8 +58,7 @@ public class UsersController : ControllerBase
|
|||||||
Fio = user.Fio,
|
Fio = user.Fio,
|
||||||
Specialities = user.Specialities,
|
Specialities = user.Specialities,
|
||||||
TelegramBotUrl = user.TelegramBotUrl,
|
TelegramBotUrl = user.TelegramBotUrl,
|
||||||
UserName = user.Username,
|
UserName = user.Username
|
||||||
Email = user.Email
|
|
||||||
};
|
};
|
||||||
var result = await _userManager.CreateAsync(userWr);
|
var result = await _userManager.CreateAsync(userWr);
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ public class UsersController : ControllerBase
|
|||||||
fuser.Specialities = user.Specialities;
|
fuser.Specialities = user.Specialities;
|
||||||
fuser.TelegramBotUrl = user.TelegramBotUrl;
|
fuser.TelegramBotUrl = user.TelegramBotUrl;
|
||||||
fuser.UserName = user.Username;
|
fuser.UserName = user.Username;
|
||||||
fuser.Email = user.Email;
|
|
||||||
var result = await _userManager.UpdateAsync(fuser);
|
var result = await _userManager.UpdateAsync(fuser);
|
||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
return Ok();
|
return Ok();
|
||||||
@ -141,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(nameof(SignInWithGoogleCallback)) };
|
var properties = new AuthenticationProperties { RedirectUri = "https://cyberbloom.zetcraft.ru/api/users/signin-google" };
|
||||||
return Challenge(properties, GoogleDefaults.AuthenticationScheme);
|
return Challenge(properties, GoogleDefaults.AuthenticationScheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,4 @@ public class UserPost
|
|||||||
public string Specialities { get; set; } = null!;
|
public string Specialities { get; set; } = null!;
|
||||||
|
|
||||||
public string TelegramBotUrl { get; set; } = null!;
|
public string TelegramBotUrl { get; set; } = null!;
|
||||||
|
|
||||||
public string Email { get; set; } = null!;
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,4 @@ public class UserPut
|
|||||||
public string Specialities { get; set; } = null!;
|
public string Specialities { get; set; } = null!;
|
||||||
|
|
||||||
public string TelegramBotUrl { get; set; } = null!;
|
public string TelegramBotUrl { get; set; } = null!;
|
||||||
|
|
||||||
public string Email { get; set; } = null!;
|
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ 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.CallbackPath = "/api/signin-google";
|
options.CallbackPath = "https://cyberbloom.zetcraft.ru/api/users/google-sign-in";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user