Merge pull request #744 from Cucumberrbob/fix/setup-provider-auth

fix: require auth to setup provider
This commit is contained in:
Roger Far 2025-03-21 14:59:52 -06:00 committed by GitHub
commit 67b699605a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);