Commit 8c2249b
authored
fix(auth): speed up sign-out and show pending state on logout (#378)
## Why
Clicking "Log out" appeared to do nothing for several seconds: server
actions POST to the current page URL, so the browser sat waiting on a
request to e.g. `/dashboard/<team>/sandboxes/monitoring?...` while
`completeOrySignOut` ran 4 sequential network round-trips (Auth.js
sign-out, Hydra consent + login revocation, Kratos session deletion)
before returning the redirect — with no pending UI.
## What
- Run the independent Hydra OAuth and Kratos revocations concurrently in
`completeOrySignOut`, and the two Hydra calls (consent + login)
concurrently as well — ~3 sequential round-trips collapse to the slowest
one; all helpers already log-and-swallow errors and Kratos retries 429
contention.
- Invoke the sign-out action inside a sync `useTransition` callback
(`void signOutAction()`, not awaited — the action redirects via
NEXT_REDIRECT and awaiting it surfaces noisy aborted-action errors).
- Close the dropdown on logout click and show a fullscreen "Logging
out..." overlay until the redirect lands, portaled to `document.body` so
the sidebar's `fixed z-20` stacking context can't trap it under the
sticky dashboard header (z-50).1 parent 8da8dce commit 8c2249b
5 files changed
Lines changed: 35 additions & 10 deletions
File tree
- src
- core/server/auth/ory
- features/dashboard/sidebar
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
| |||
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
111 | 128 | | |
0 commit comments