- Notifications
You must be signed in to change notification settings - Fork1
Commit208225b
authored
fix: remember token when switching deployments (#120)
If we log in on deployment 1, then log out and login to deployment 2 andthen in the same session we try to log in back to deployment 1, thetoken is no longer valid. The plugin will associate with deployment 1the token from the second deployment.There is an overly complicated block of code inherited from Gatewayplugin with multiple fallback sequences for both the deployment url andtoken from multiple sources (secrets store, data dir config, env,etc...). This fix simplifies the approach, we only store the url and thetoken in the secrets store, the token is always associated to ahostname. If there is no previous URL to remember (like the first timelogin) we default tohttps://dev.coder.com/ and empty token.1 parente4ce4c4 commit208225b
File tree
14 files changed
+134
-231
lines changed- src
- main/kotlin/com/coder/toolbox
- browser
- settings
- store
- views
- state
- test/kotlin/com/coder/toolbox/settings
14 files changed
+134
-231
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| 13 | + | |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
| 67 | + | |
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| |||
336 | 336 |
| |
337 | 337 |
| |
338 | 338 |
| |
| 339 | + | |
339 | 340 |
| |
340 | 341 |
| |
341 | 342 |
| |
|
Lines changed: 6 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
4 | 3 |
| |
5 | 4 |
| |
6 | 5 |
| |
| |||
13 | 12 |
| |
14 | 13 |
| |
15 | 14 |
| |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
46 | 44 |
| |
| 45 | + | |
47 | 46 |
| |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 | 47 |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
| 3 | + | |
3 | 4 |
| |
4 |
| - | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
|
Lines changed: 1 addition & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 | 119 |
| |
130 | 120 |
| |
131 | 121 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
| 4 | + | |
4 | 5 |
| |
5 | 6 |
| |
6 | 7 |
| |
| |||
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 |
|
Lines changed: 1 addition & 44 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 | 6 |
| |
8 | 7 |
| |
9 | 8 |
| |
| |||
35 | 34 |
| |
36 | 35 |
| |
37 | 36 |
| |
38 |
| - | |
| 37 | + | |
39 | 38 |
| |
40 | 39 |
| |
41 | 40 |
| |
| |||
71 | 70 |
| |
72 | 71 |
| |
73 | 72 |
| |
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 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 | 73 |
| |
117 | 74 |
| |
118 | 75 |
| |
|
Lines changed: 17 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| 6 | + | |
| 7 | + | |
6 | 8 |
| |
7 | 9 |
| |
8 | 10 |
| |
| |||
23 | 25 |
| |
24 | 26 |
| |
25 | 27 |
| |
| 28 | + | |
26 | 29 |
| |
27 | 30 |
| |
28 |
| - | |
29 |
| - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
30 | 38 |
| |
31 | 39 |
| |
32 | 40 |
| |
33 | 41 |
| |
34 | 42 |
| |
35 | 43 |
| |
36 | 44 |
| |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
37 | 52 |
| |
38 | 53 |
| |
39 | 54 |
| |
|
Lines changed: 20 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 |
| - | |
54 |
| - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 |
| |
56 | 62 |
| |
57 | 63 |
| |
58 | 64 |
| |
59 | 65 |
| |
60 | 66 |
| |
61 | 67 |
| |
62 |
| - | |
63 |
| - | |
64 |
| - | |
| 68 | + | |
65 | 69 |
| |
66 | 70 |
| |
67 | 71 |
| |
68 | 72 |
| |
69 |
| - | |
| 73 | + | |
70 | 74 |
| |
71 | 75 |
| |
72 | 76 |
| |
73 | 77 |
| |
74 | 78 |
| |
75 | 79 |
| |
76 |
| - | |
| 80 | + | |
77 | 81 |
| |
78 | 82 |
| |
79 |
| - | |
80 |
| - | |
| 83 | + | |
| 84 | + | |
81 | 85 |
| |
82 | 86 |
| |
83 | 87 |
| |
| |||
92 | 96 |
| |
93 | 97 |
| |
94 | 98 |
| |
95 |
| - | |
| 99 | + | |
96 | 100 |
| |
97 | 101 |
| |
98 |
| - | |
| 102 | + | |
99 | 103 |
| |
| 104 | + | |
100 | 105 |
| |
101 | 106 |
| |
102 |
| - | |
| 107 | + | |
103 | 108 |
| |
104 | 109 |
| |
105 | 110 |
| |
106 | 111 |
| |
107 |
| - | |
| 112 | + | |
108 | 113 |
| |
109 | 114 |
| |
110 | 115 |
| |
| |||
120 | 125 |
| |
121 | 126 |
| |
122 | 127 |
| |
| 128 | + | |
123 | 129 |
| |
124 | 130 |
| |
125 | 131 |
| |
|
0 commit comments
Comments
(0)