diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 8f43a9b..46d91d1 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -84,6 +84,9 @@ jobs: - name: Validate admin render mode run: bash scripts/validate_admin_render.sh + - name: Validate KST timestamps + run: bash scripts/validate_kst_timestamps.sh + - name: Generate build info run: | COMMIT_HASH=$(git rev-parse --short HEAD) @@ -127,7 +130,7 @@ jobs: run: | set -e export TAXBAIK_DEPLOY_FROM_CI=1 - TIMESTAMP=$(date +%Y%m%d_%H%M%S) + TIMESTAMP=$(TZ=Asia/Seoul date +%Y%m%d_%H%M%S) COMMIT=$(git rev-parse --short HEAD) DEPLOY_HOST="${{ secrets.DEPLOY_HOST }}" DEPLOY_USER="${{ secrets.DEPLOY_USER }}" diff --git a/TaxBaik.Web.Client/Services/CustomAuthenticationStateProvider.cs b/TaxBaik.Web.Client/Services/CustomAuthenticationStateProvider.cs index e46b81f..2c3cae2 100644 --- a/TaxBaik.Web.Client/Services/CustomAuthenticationStateProvider.cs +++ b/TaxBaik.Web.Client/Services/CustomAuthenticationStateProvider.cs @@ -38,7 +38,7 @@ public class CustomAuthenticationStateProvider : AuthenticationStateProvider { var refreshToken = await _localStorage.GetItemAsStringAsync("refreshToken"); var ticksStr = await _localStorage.GetItemAsStringAsync("tokenExpiry"); - if (long.TryParse(ticksStr, out var ticks)) + if (TryNormalizeExpiryTicks(ticksStr, out var ticks)) { _tokenStore.AccessToken = storedToken; _tokenStore.RefreshToken = refreshToken; @@ -130,6 +130,30 @@ public class CustomAuthenticationStateProvider : AuthenticationStateProvider NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } + private static bool TryNormalizeExpiryTicks(string? rawValue, out long ticks) + { + ticks = 0; + if (!long.TryParse(rawValue, out var parsed)) + { + return false; + } + + // Support both legacy Unix-millisecond storage and .NET ticks. + if (parsed > 10_000_000_000_000L && parsed < 100_000_000_000_000_000L) + { + ticks = parsed; + return true; + } + + if (parsed > 1_000_000_000_000L && parsed < 100_000_000_000_000L) + { + ticks = DateTimeOffset.FromUnixTimeMilliseconds(parsed).UtcDateTime.Ticks; + return true; + } + + return false; + } + private bool ShouldRefreshToken() { // 토큰이 5분 이내로 만료되면 갱신 (300초 = 5분) diff --git a/TaxBaik.Web/Components/Admin/App.razor b/TaxBaik.Web/Components/Admin/App.razor index b190a80..7a909ad 100644 --- a/TaxBaik.Web/Components/Admin/App.razor +++ b/TaxBaik.Web/Components/Admin/App.razor @@ -1,4 +1,5 @@ @using Microsoft.AspNetCore.Components.Web +@inject VersionInfo VersionInfo
@@ -12,6 +13,8 @@ + diff --git a/TaxBaik.Web/Components/Admin/Forms/InquiryForm.razor b/TaxBaik.Web/Components/Admin/Forms/InquiryForm.razor index ff6cd6e..6b75cf5 100644 --- a/TaxBaik.Web/Components/Admin/Forms/InquiryForm.razor +++ b/TaxBaik.Web/Components/Admin/Forms/InquiryForm.razor @@ -3,31 +3,36 @@ @using TaxBaik.Web.Components.Admin.Shared