Commit 7b879f8
committed
feat(FR-2627): migrate EduAppLauncher sToken path to STokenLoginBoundary
Story 3 of Epic FR-2616. EduAppLauncher no longer owns sToken
authentication or `window.location` parsing. The route page wraps the
component with STokenLoginBoundary via a useSToken-backed capture, and
the component receives sToken and remaining query parameters as props.
EduAppLauncherPage (react/src/pages/EduAppLauncherPage.tsx):
- Reads sToken via useSToken (nuqs) and snapshots it with useState
before any onSuccess-driven URL cleanup.
- Collects remaining URL params (app, session_id, resource hints)
once at mount into capturedExtraParams.
- When sToken is present, wraps its content in STokenLoginBoundary
with the captured sToken and extraParams. onSuccess calls
persistPostLoginState (counters, credential cleanup, endpoint
localStorage, client.ready) and clearSToken(null) to strip sToken /
stoken from the URL without touching unrelated params
(spec Pitfall #7).
- Without an sToken, the boundary is skipped and the launcher runs
directly (existing edu integrations that carry a valid session cookie
without a URL token keep working).
- Threads sToken and extraParams through EduAppLauncherPageContent to
EduAppLauncher as props.
EduAppLauncher (react/src/components/EduAppLauncher.tsx):
- New optional props `sToken: string | null` and `extraParams:
Record<string, string>`; legacy callers that pass neither still work
(defaults provided).
- Removes `_token_login` and the manual `document.dispatchEvent(
'backend-ai-connected')` call at the top of `_launch`; the boundary
owns both now.
- Replaces `_initClient` (client creation + proxyURL + get_manager
_version + ready) with `_attachProxyURL`, which only layers the
wsproxy URL on top of the boundary-authenticated client. Client
construction, version ping, and `ready` flag are owned by the
boundary + persistPostLoginState.
- `_launch` and `_createEduSession` read app / session_id / resource
hints from `extraParams` and sToken from the `sToken` prop instead
of `new URLSearchParams(window.location.search)`. The existing
customer-specific `eduApp.get_user_credential(sToken)` call in step
4c keeps working because the prop captures the token before the
URL-cleanup round-trips back to render (FR-2640 resolution).
Behavior change:
- sToken is now stripped from the URL after successful boundary auth
(spec Story 3). Prior EduAppLauncher left it in place, which
leaked the token into browser history / referer headers. Other
query params remain as before.
Resolves FR-2641, FR-2642 (bundled — same files, tightly coupled).
FR-2640 is resolved separately as investigation-only. FR-2643
(E2E regression) follows in a separate PR.
Refs FR-2616, FR-26271 parent 7c7561a commit 7b879f8
3 files changed
Lines changed: 153 additions & 134 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
| |||
94 | 109 | | |
95 | 110 | | |
96 | 111 | | |
| 112 | + | |
| 113 | + | |
97 | 114 | | |
98 | 115 | | |
99 | 116 | | |
| |||
164 | 181 | | |
165 | 182 | | |
166 | 183 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
174 | 190 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 197 | | |
238 | 198 | | |
239 | 199 | | |
| |||
396 | 356 | | |
397 | 357 | | |
398 | 358 | | |
399 | | - | |
400 | | - | |
| 359 | + | |
401 | 360 | | |
402 | 361 | | |
403 | | - | |
404 | | - | |
| 362 | + | |
| 363 | + | |
405 | 364 | | |
406 | 365 | | |
407 | 366 | | |
| |||
619 | 578 | | |
620 | 579 | | |
621 | 580 | | |
622 | | - | |
623 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
624 | 585 | | |
625 | 586 | | |
626 | 587 | | |
| |||
737 | 698 | | |
738 | 699 | | |
739 | 700 | | |
740 | | - | |
741 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
742 | 708 | | |
743 | 709 | | |
744 | 710 | | |
745 | 711 | | |
746 | 712 | | |
747 | | - | |
| 713 | + | |
748 | 714 | | |
749 | | - | |
| 715 | + | |
750 | 716 | | |
751 | 717 | | |
752 | 718 | | |
| |||
756 | 722 | | |
757 | 723 | | |
758 | 724 | | |
759 | | - | |
760 | 725 | | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
766 | 731 | | |
767 | 732 | | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | 733 | | |
794 | 734 | | |
795 | 735 | | |
| |||
803 | 743 | | |
804 | 744 | | |
805 | 745 | | |
806 | | - | |
| 746 | + | |
807 | 747 | | |
808 | 748 | | |
809 | 749 | | |
810 | 750 | | |
811 | | - | |
| 751 | + | |
812 | 752 | | |
813 | 753 | | |
814 | 754 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
32 | 24 | | |
33 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
38 | | - | |
| 33 | + | |
39 | 34 | | |
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
44 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
0 commit comments