tangoclinh1995 / thehonorclub-mobileapp

The Honor Club's Mobile App Project for COMP 3111H
2 stars 1 forks source link

Oauth - #85

Closed jshin49 closed 7 years ago

jshin49 commented 7 years ago
  1. Fixed app.js to not check user login status with firebase SDK. (left it out as commented)
    • Instead, check as the following in the controller of each page:
var currentUser = $firebaseAuthInstance.$getAuth();
console.log(currentUser);
if (currentUser == undefined) {
    console.log(currentUser);
    $state.go('login');
}

currentUser will be undefined if the user status is null.

  1. Added a state monitor to check where the previous page came from. (for now it only checks where it's from so that I can decided whether to allow the back button or not, but this can be useful later on).

  2. Created an intermediary step when Logging in called Loading. (This step is necessary as when the user logs in, the page will be refreshed and everything gets reset.)