Skip to content

Commit

Permalink
Improve debug (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored Feb 12, 2024
1 parent 7ea3c81 commit ecbefb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions native_gg/src/authentication/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class AuthService {
// Method to check if user data and auth token exist
isAuthenticated(): boolean {
const user = this.currentUserID;
console.log("isAuthenticated", user, this.authToken);
return user && this.authToken ? true : false;
}

Expand All @@ -107,13 +108,17 @@ class AuthService {
this.currentUserID = membership_id;
if (this.dispatch) {
this.dispatch({ type: "setCurrentUserID", payload: membership_id });
} else {
console.error("No dispatch");
}
}

setAuthToken(token: RefreshToken | null) {
this.authToken = token;
if (this.dispatch) {
this.dispatch({ type: "setAuthenticated", payload: this.isAuthenticated() });
} else {
console.error("No dispatch");
}
}

Expand Down

0 comments on commit ecbefb9

Please sign in to comment.