Commit 886f98b
authored
fix(auth): improve OpenID token error handling (#1928)
In packages/zudoku/src/lib/authentication/providers/openid.tsx
destructure setLoggedOut and call it to mark the user logged out when
provider data is missing or when token exchange fails. Replace the
previous silent return of an empty string with an AuthorizationError
when no refresh token is present. Also call setLoggedOut and throw an
AuthorizationError when the token refresh response lacks an access
token.
These changes keep the authentication state consistent and surface
explicit errors to callers instead of returning empty tokens that could
lead to incorrect downstream behavior.1 parent cead1db commit 886f98b
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
| 222 | + | |
222 | 223 | | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | | - | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
| |||
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| 252 | + | |
250 | 253 | | |
251 | 254 | | |
252 | 255 | | |
| |||
0 commit comments