Skip to content

Commit

Permalink
fix: add check refresh token to getMe method
Browse files Browse the repository at this point in the history
  • Loading branch information
LorexIQ committed Nov 23, 2023
1 parent 5768fcc commit 1ebac89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/runtime/composables/useLocalAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ async function getMe<T extends UseLocalAuthResponse = {}>(): Promise<T> {

if (!token.value) throw new LocalAuthError('getMe > token is null. SignIn first');

try {
await refreshTokenWithCheck();
} catch (e) {}

try {
const meData = await fetch<T>(endpointConfig, { withToken: true });

Expand Down

0 comments on commit 1ebac89

Please sign in to comment.