fix: require auth to setup provider

This commit is contained in:
Cucumberrbob 2025-03-09 14:50:51 +00:00
parent a366328472
commit 983e357a01
No known key found for this signature in database
GPG key ID: 2B935C47401C3614

View file

@ -67,7 +67,7 @@ public class AuthController(Authentication authentication, Settings settings) :
return Ok();
}
[AllowAnonymous]
[Authorize(Policy = "AuthSetting")]
[Route("SetupProvider")]
[HttpPost]
public async Task<ActionResult> SetupProvider([FromBody] AuthControllerSetupProviderRequest? request)
@ -82,13 +82,6 @@ public class AuthController(Authentication authentication, Settings settings) :
return StatusCode(401);
}
var user = await authentication.GetUser();
if (user != null)
{
return StatusCode(401);
}
await settings.Update("Provider:Provider", request.Provider);
await settings.Update("Provider:ApiKey", request.Token);