Ejemplo n.º 1
0
 checkProfileStatus = () => {
   Auth.currentAuthenticatedUser()
     .then(user => {
       logger.info('got user:', user);
     })
     .catch(err => {
       // this.setState({ authState: "signIn", authData: null });
       this.props.navigation.state.params.onAuthStateChange("signedOut", null);
       logger.error(err);
     });
 };
Ejemplo n.º 2
0
 checkProfileStatus = async () => {
   try {
     const user = await Auth.currentAuthenticatedUser();
     const { attributes } = user || {};
     console.log("checking", attributes);
     if (!isProfileComplete(attributes)) {
       console.log("not complete");
       this.props.navigation.navigate("ProfileSetup");
     }
   } catch (err) {
     logger.error(err);
     AuthService.setAuthState("signedOut", null);
   }
 };