Commit 0403ee2
committed
impl: rework the handling of missing token code
- the existing code was trying indefinitely to ask for token until the user gets it right.
This is not a bad idea, however Toolbox has a couple of limitations that make the existing
approach almost unusable:
- the input dialog doesn't allow custom actions through which we can spawn a browser at login page.
The code always opened the login page when the token was wrong which ended up hammering the browser
with too many tabs.
- the token UI page can't be reused to request the login page (this one has a "Get token" action button)
because once the user clicks on the Get token to open the webpage, Toolbox closes the window and forgets
the last UI page that was visible.
- instead with this patch we ask the token from the user only once. If something goes wrong (mostly during login)
we show an error dialog and stop the flow.1 parent 3108f7d commit 0403ee2
File tree
3 files changed
+38
-90
lines changed- src/main/kotlin/com/coder/toolbox
- util
- views
3 files changed
+38
-90
lines changedLines changed: 14 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 49 | + | |
57 | 50 | | |
58 | 51 | | |
59 | 52 | | |
| |||
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 154 | + | |
| 155 | + | |
166 | 156 | | |
167 | 157 | | |
168 | 158 | | |
169 | 159 | | |
170 | | - | |
171 | | - | |
| 160 | + | |
172 | 161 | | |
173 | 162 | | |
174 | 163 | | |
175 | 164 | | |
176 | | - | |
| 165 | + | |
177 | 166 | | |
178 | 167 | | |
| 168 | + | |
| 169 | + | |
179 | 170 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 171 | + | |
186 | 172 | | |
187 | 173 | | |
188 | 174 | | |
189 | 175 | | |
| 176 | + | |
190 | 177 | | |
191 | 178 | | |
192 | 179 | | |
| |||
195 | 182 | | |
196 | 183 | | |
197 | 184 | | |
198 | | - | |
| 185 | + | |
199 | 186 | | |
200 | | - | |
| 187 | + | |
201 | 188 | | |
202 | 189 | | |
203 | 190 | | |
204 | 191 | | |
205 | 192 | | |
206 | 193 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
215 | 197 | | |
216 | 198 | | |
217 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 28 | | |
33 | 29 | | |
34 | 30 | | |
| |||
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
43 | 54 | | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
106 | 72 | | |
107 | 73 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments