GeezerVison is showing github.com — 로그아웃 직후 SSO 자동 시작이 되돌리지 않게 한다 · datamaker/vault@89d43f1
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/frontend/src/components/layout/Layout.tsx +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -95,8 +95,11 @@ export function Layout({ children }: LayoutProps) { |
95 | 95 | } catch { |
96 | 96 | // ignore |
97 | 97 | } |
| 98 | + // ProtectedRoute redirects to a bare /login as soon as the store flips, so |
| 99 | + // the ?local=1 below can get lost. The skip flag is what the login page |
| 100 | + // actually honours; local=1 is kept for the manual/bookmark case. |
| 101 | + sessionStorage.setItem('vault_sso_skip', '1'); |
98 | 102 | logout(); |
99 | | - // local=1 keeps the login page from bouncing straight back through SSO |
100 | 103 | navigate('/login?local=1'); |
101 | 104 | }; |
102 | 105 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: apps/frontend/src/pages/Login.tsx +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,11 +46,13 @@ export function Login() { |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | const local = new URLSearchParams(window.location.search).get('local') === '1'; |
| 49 | + const skip = sessionStorage.getItem('vault_sso_skip') === '1'; // set by Logout |
| 50 | + sessionStorage.removeItem('vault_sso_skip'); |
49 | 51 | const bounced = Number(sessionStorage.getItem(AUTO_FLAG) ?? 0) > Date.now() - 60_000; |
50 | 52 | getOidcStatus() |
51 | 53 | .then(({ enabled }) => { |
52 | 54 | setSsoEnabled(enabled); |
53 | | - if (enabled && !local && !bounced) { |
| 55 | + if (enabled && !local && !skip && !bounced) { |
54 | 56 | sessionStorage.setItem(AUTO_FLAG, String(Date.now())); |
55 | 57 | window.location.replace('/api/v1/auth/oidc/start'); |
56 | 58 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "name": "vault", |
3 | | - "version": "2.1.3", |
| 3 | + "version": "2.1.4", |
4 | 4 | "private": true, |
5 | 5 | "workspaces": [ |
6 | 6 | "packages/*", |
|