Skip to content

Commit

Permalink
Removed: unused assignment to a variable on api call(#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed May 27, 2024
1 parent d3d2162 commit 96a65d7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/store/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,9 @@ export const useAuthStore = defineStore('authStore', {
if(!payload?.isUserUnauthorised) {
emitter.emit("presentLoader",{ message: "Logging out...", backdropDismiss: false });

// wrapping the parsing logic in try catch as in some case the logout api makes redirection, and then we are unable to parse the resp and thus the logout process halts
// wrapping the parsing logic in try catch as in some case the logout api makes redirection, or fails when logout from maarg based apps, thus the logout process halts
try {
let resp;
resp = await logout();

// Added logic to remove the `//` from the resp as in case of get request we are having the extra characters and in case of post we are having 403
resp = JSON.parse(resp.startsWith('//') ? resp.replace('//', '') : resp)
await logout();
} catch(err) {
console.error('Error parsing data', err)

Check warning on line 102 in src/store/auth.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 102 in src/store/auth.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
Expand Down

0 comments on commit 96a65d7

Please sign in to comment.