Skip to content

fix(browser): create storageState dir if missing#1527

Open
dannysauer wants to merge 1 commit into
Versent:masterfrom
neverendingsupport:fix/browser-storagestate-mkdir
Open

fix(browser): create storageState dir if missing#1527
dannysauer wants to merge 1 commit into
Versent:masterfrom
neverendingsupport:fix/browser-storagestate-mkdir

Conversation

@dannysauer

Copy link
Copy Markdown

What

context.StorageState() silently fails when ~/.aws/saml2aws/ doesn't exist, so the Playwright session is never persisted and users are forced to re-authenticate on every saml2aws login. Adds an os.MkdirAll call before the write so the directory is always created on first run.

Why

Fresh installs never have ~/.aws/saml2aws/ — nothing in the setup flow creates it. The failure is logged at INFO level and swallowed, so users never know session persistence is broken.

Changes

  • pkg/provider/browser/browser.go: add os.MkdirAll(filepath.Dir(storageStatePath), 0700) before context.StorageState() in the defer block; add path/filepath import.

Closes: #1526

context.StorageState() silently fails when ~/.aws/saml2aws/ doesn't
exist, which means sessions never persist on a fresh install. Add an
os.MkdirAll call before writing so the directory is always present.

Fixes: https://github.com/Versent/saml2aws/issues/[TBD]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browser provider: session storageState silently fails to persist when ~/.aws/saml2aws/ directory doesn't exist

1 participant