Files
zitadel/.gitignore
T
3c746281f1 fix(login): show account selection after RP-initiated logout (#12638)
**Supersedes #12471** by @conblem — same fix, rebased onto current
`main` with conflicts resolved and review feedback applied. Original
commits are preserved, all credit to @conblem.

Closes #12252

### Problem

After an RP-initiated logout (`end_session` with `id_token_hint`), Login
V2 redirected straight to `/loginname` instead of showing the account
picker like Login V1. The `sessions` cookie still referenced the
previous accounts, but their server-side sessions had been terminated,
so `listSessions` returned nothing and the flow treated the browser as
having no accounts at all.

### Solution

- `handleOIDCFlowInitiation` now checks the `sessions` cookie
(`hasCookieAccount`) when no live session is eligible for the request's
organization. If the cookie still knows an account and the RP passed no
`login_hint`, the user is sent to `/accounts` instead of `/loginname`.
`prompt=none` is excluded since it must never render UI.
- `/accounts` synthesizes an (invalid) `Session` for each cookie entry
that has no live counterpart, so the account is still listed and a click
re-authenticates via `/loginname` → password in one step.
- `clearSession` prunes the cookie entry when the server reports the
session as already gone (`NotFound` / `PermissionDenied`), so stale
cards can be dismissed. Any other error is rethrown so a still-valid
server session is never silently orphaned.
- `getAllSessionCookieIds` is now a thin wrapper over `getAllSessions`;
`FlowInitiationParams.sessionCookies` is typed as `Cookie[]`.
- Tests: new `describe` block covering the cookie fallback, `login_hint`
precedence, `prompt=none`, org-scope matching/mismatch, and
`SELECT_ACCOUNT` / default prompt with live sessions filtered out by
org.
- Also adds `.claude/`, `.cursor/`, `.codex/`, `.windsurf/`,
`.copilot/`, `.aider*` to `.gitignore`.

---------

Co-authored-by: conblem <[email protected]>
2026-08-27 11:07:30 +00:00

119 lines
1.7 KiB
Plaintext

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
!/**/.env.test
# Coverage
coverage.txt
profile*.cov
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
#Debug
__debug_bin*
debug
sandbox.go
/cmd/dev/
# IDE
.idea
.DS_STORE
.run
.vscode
# credential
google-credentials
key.json
.keys/*
load-test/.keys
*.pat
# dumps
.backups
.local/*
.build/
#binaries
cmd/zitadel/zitadel
**/statik/statik.go
/zitadelctl
/zitadel
# buildfolders and generated files
console/dist
console/src/app/proto/generated
console/src/assets/docs
console/.angular
**.pb.go
!pkg/grpc/protoc/v2/options.pb.go
**.proto.mock.go
**.pb.*.go
pkg/**/**.connect.go
**.gen.go
openapi/**/*.json
# multi-version proto artifacts
/proto/latest/
/proto/v*/
/internal/api/assets/authz.go
/internal/api/assets/router.go
internal/api/ui/console/static
!internal/api/ui/console/static/gitkeep
apps/docs/content/apis/assets/assets.mdx
apps/docs/content/reference/api/
/internal/api/ui/login/static/resources/themes/zitadel/css/zitadel.css
/internal/api/ui/login/static/resources/themes/zitadel/css/zitadel.css.map
/zitadel-*-*
!apps/**/zitadel-*-*
# local
build/local/*.env
.notifications
.artifacts/*
!.artifacts/bin
.artifacts/bin/*/*/**/*
!.artifacts/zitadel
/zitadel
node_modules/
.kreya
.env.*local
go.work
go.work.sum
# Local Netlify folder
.netlify
.vercel
# PNPM
.pnpm-store
# Nx
.nx/cache
.nx/workspace-data
.cursor/rules/nx-rules.mdc
# AI Files
CLAUDE.md
.mcp.json
.gemini/*
.claude/
.cursor/
.codex/
.windsurf/
.copilot/
.aider*
docs_old
apps/docs/package-lock.json
# Auto-generated by Next.js (rewrites on every dev/build)
next-env.d.ts