From 09f586dcac4f27835912d65f4234e8d960ec4775 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 06:39:43 +0000 Subject: [PATCH 1/2] Initial plan From da9b3600e4017a0ae795e7d4d5b67758ad1ced8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 06:45:17 +0000 Subject: [PATCH 2/2] Fix Windows token save failing on first login due to incorrect Test-Path check in PowerShell script The saveToWindowsDpapi script checked `Test-Path $env:GHPV_PATH` (file existence) before saving. On first login the destination file does not exist yet, so Test-Path returns false, the script exits with code 1, and the token is never written to disk. Subsequent restarts find no token file and log the user out every time. Fix: replace the file-existence guard with an env-var-is-set guard (`[string]::IsNullOrWhiteSpace($env:GHPV_PATH)`) so the script only aborts when the path variable is not provided, not when the file is absent. Co-authored-by: HayatoYagi <26685974+HayatoYagi@users.noreply.github.com> Agent-Logs-Url: https://github.com/HayatoYagi/PRs_Visualizer/sessions/e87c1986-c9a4-43ff-b2ab-550bf140ca44 --- .../hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt b/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt index 82c9391..1107027 100644 --- a/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt +++ b/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt @@ -109,7 +109,7 @@ object GitHubTokenStore { val path = windowsTokenFilePath() val script = """ - |if (!(Test-Path ${'$'}env:$WINDOWS_TOKEN_ENV_PATH)) { exit 1 } + |if ([string]::IsNullOrWhiteSpace(${'$'}env:$WINDOWS_TOKEN_ENV_PATH)) { exit 1 } |${'$'}dir = [IO.Path]::GetDirectoryName(${'$'}env:$WINDOWS_TOKEN_ENV_PATH) |if (!(Test-Path ${'$'}dir)) { New-Item -Path ${'$'}dir -ItemType Directory | Out-Null } |${'$'}secure = ConvertTo-SecureString -String ${'$'}env:$WINDOWS_TOKEN_ENV_VALUE -AsPlainText -Force