Commit a940e3f
committed
fix(sdk): re-introduce loginWithToken wrap with stricter guards
Re-add the auto-relogin auth-error handler that fixes e2ee-key-reset and
device-management force-logout flows, with two extra guards to avoid
the SAML regression that the previous version caused:
- readStoredLoginToken() === token: nothing rotated the stored token
mid-flight (a concurrent SAML/password/OAuth login already wrote a
fresh one)
- sdk.account.uid === triedWithUid: the SDK account didn't get
refreshed by a successful adopt while we were awaiting (a parallel
Meteor-routed login completed and updated the in-memory state)
If both guards hold, the only plausible explanation is a true server
force-logout (Users.unsetLoginTokens), so we drop local credentials and
let the router fall back to Login.
Verified locally: login.spec, account-login, e2ee-key-reset and
omnichannel-rooms-forward all pass.1 parent 2e721a2 commit a940e3f
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
215 | 259 | | |
216 | 260 | | |
217 | 261 | | |
| |||
0 commit comments