Fix set-avatar auth flow and API avatar upload stability
All checks were successful
Dotnet build and test / build (pull_request) Successful in 8m5s
All checks were successful
Dotnet build and test / build (pull_request) Successful in 8m5s
This commit is contained in:
parent
7a1a9ad2ee
commit
b820348558
10 changed files with 115 additions and 117 deletions
|
|
@ -10,7 +10,7 @@ using System.Diagnostics;
|
|||
|
||||
namespace Yavsc.WebApi.Controllers
|
||||
{
|
||||
[Route("~/api/account")]
|
||||
[Route( Constants.APIPrefix + "/account")]
|
||||
[Authorize("ApiScope")]
|
||||
public class ApiAccountController : Controller
|
||||
{
|
||||
|
|
@ -61,12 +61,12 @@ namespace Yavsc.WebApi.Controllers
|
|||
return Ok(new { host = Request.ForwardedFor() });
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates the avatar
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("~/api/set-avatar")]
|
||||
[HttpPost("set-avatar")]
|
||||
public async Task<IActionResult> SetAvatar()
|
||||
{
|
||||
var user = await GetUserData(User.GetUserId());
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ using Yavsc.Helpers;
|
|||
using Yavsc.Interface;
|
||||
using Yavsc.Interfaces;
|
||||
using Yavsc.Models;
|
||||
using Yavsc;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Yavsc.Services;
|
||||
|
||||
|
|
@ -32,6 +33,7 @@ internal class Program
|
|||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.AddConfiguration("api");
|
||||
Config.SiteSetup = builder.Configuration.GetSection("Site").Get<SiteSettings>() ?? new SiteSettings();
|
||||
|
||||
var services = builder.Services;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
"Site": {
|
||||
"Authority": "https://localhost:5001",
|
||||
"CorsAllowedOrigins": [
|
||||
"https://localhost:5003"
|
||||
"https://localhost:5003",
|
||||
"https://yavsc.pschneider.fr"
|
||||
]
|
||||
},
|
||||
"Logging": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue