Skip to content

Commit

Permalink
clear user state only for identity endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
manchenkoff committed Apr 4, 2024
1 parent 20e7cc9 commit 112d67a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/httpFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ export function createHttpClient(): $Fetch {
}
},

async onResponseError({ response }): Promise<void> {
if (response.status === 401) {
async onResponseError({ request, response }): Promise<void> {
if (
response.status === 401 &&
request.toString().endsWith(options.endpoints.user)
) {
user.value = null;
}
},
Expand Down

0 comments on commit 112d67a

Please sign in to comment.