Skip to content

Commit

Permalink
Fixed bug where if session token was deleted the page did not work.
Browse files Browse the repository at this point in the history
  • Loading branch information
elrumo committed Mar 21, 2021
1 parent ddb9f2e commit fae67bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions website/macos-big-sur-icons/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ export default {
parent.getIconsArray();
}).catch((e)=>{
console.log("login: ", e);
Parse.User.logOut();
handleParseError(e)
})
}
Expand Down Expand Up @@ -652,6 +653,19 @@ export default {
async getIconsArray(){
let parent = this
function handleParseError(err){
switch (err.code) {
case Parse.Error.INVALID_SESSION_TOKEN:
Parse.User.logOut();
window.location.reload()
break;
default:
break;
}
}
try {
const query = new Parse.Query(Icons);
Expand Down Expand Up @@ -688,6 +702,7 @@ export default {
} catch (error) {
parent.loadingError = "true"
handleParseError(error)
console.log("loadingError: ", error);
}
Expand Down

1 comment on commit fae67bb

@vercel
Copy link

@vercel vercel bot commented on fae67bb Mar 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.