Skip to content

Commit

Permalink
Merge pull request #91 from qJake/auth-fix
Browse files Browse the repository at this point in the history
Fix initial setup bug
  • Loading branch information
qJake authored Apr 11, 2020
2 parents 0813ab5 + ba2edfc commit 0b5d13d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Docker/BuildHaccContainers.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$version = '1.0.17'
$version = '1.0.18'

function Test-ExitCode ([int] $Expected = 0)
{
Expand Down
7 changes: 6 additions & 1 deletion HADotNet.CommandCenter/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using HADotNet.CommandCenter.Services.Interfaces;
using HADotNet.CommandCenter.Utils;
using HADotNet.CommandCenter.ViewModels;
using HADotNet.Core;
using HADotNet.Core.Clients;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -75,6 +76,8 @@ public async Task<IActionResult> Settings()
{
await ConfigStore.ManipulateConfig(c => c.Settings.AccessToken = c.Settings.BaseUri = null);

ClientFactory.Reset();

config = await ConfigStore.GetConfigAsync();

TempData.Remove(AlertManager.GRP_SUCCESS);
Expand All @@ -96,9 +99,11 @@ public async Task<IActionResult> Settings([FromForm] SystemSettings newSettings)
if (ModelState.IsValid)
{
newSettings ??= new SystemSettings();
newSettings.BaseUri = newSettings.BaseUri.TrimEnd('/');
newSettings.BaseUri = newSettings.BaseUri?.TrimEnd('/');
await ConfigStore.ManipulateConfig(c => c.Settings = newSettings);

ClientFactory.Reset();

TempData["check-settings"] = true;

return RedirectToAction("Settings");
Expand Down
4 changes: 2 additions & 2 deletions HADotNet.CommandCenter/HADotNet.CommandCenter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RuntimeIdentifiers>win10;alpine.3.10-x64;debian.10-arm</RuntimeIdentifiers>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyVersion>1.0.17.0</AssemblyVersion>
<FileVersion>1.0.17.0</FileVersion>
<AssemblyVersion>1.0.18.0</AssemblyVersion>
<FileVersion>1.0.18.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Deterministic>false</Deterministic>
Expand Down

0 comments on commit 0b5d13d

Please sign in to comment.