Limit what API does when not in used in Install level
(cherry picked from commit 7b00c0d3e9)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
7852220827
commit
5500f87223
@@ -87,11 +87,15 @@ public class InstallApiController : ControllerBase
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> CompleteInstall()
|
||||
{
|
||||
RuntimeLevel levelBeforeRestart = _runtime.State.Level;
|
||||
|
||||
await _runtime.RestartAsync();
|
||||
|
||||
BackOfficeIdentityUser identityUser =
|
||||
await _backOfficeUserManager.FindByIdAsync(Constants.Security.SuperUserIdAsString);
|
||||
_backOfficeSignInManager.SignInAsync(identityUser, false);
|
||||
if (levelBeforeRestart == RuntimeLevel.Install)
|
||||
{
|
||||
BackOfficeIdentityUser identityUser = await _backOfficeUserManager.FindByIdAsync(Core.Constants.Security.SuperUserIdAsString);
|
||||
_backOfficeSignInManager.SignInAsync(identityUser, false);
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user