How to use the aws-amplify.Auth.signOut function in aws-amplify

To help you get started, we’ve selected a few aws-amplify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / amazon-cognito-example-for-external-idp / ui-react / src / service / authService.ts View on Github external
async forceSignOut(){
    try {
      // revokes the refresh token, (and access token for usage with cognito APIs)
      await this.requestWithAuth("POST", "/forceSignOut");
    } finally {
      // removes tokens from localStorage
      await Auth.signOut();
    }
  }
}
github jamstack-cms / jamstack-cms / src / pages / profile.js View on Github external
signOut = () => {
    this.props.context.updateIsAdmin(false)
    Auth.signOut()
      .catch(err => console.log({ err }))
  }
  setAvatar = async () => {
github alanbo / serverless-cms / admin / src / App.tsx View on Github external
signOut() {
    Auth.signOut()
      .then(data => window.location.reload())
      .catch(err => console.log(err));
  }
github revmischa / cloudcam / ui / src / layout / header.tsx View on Github external
private logout = () => {
    Auth.signOut()
      .then(data => console.log(data))
      .catch(err => console.log(err));
  };
}
github aws-samples / aws-amplify-vue / src / amplify / components / auth / Greetings.vue View on Github external
signOut: function(event) {
        Auth.signOut()
            .then(data => {
                logger.debug('sign out success', data);
                AmplifyStore.commit('setUser', null);
                this.$router.push('/auth/signIn');
            })
            .catch(err => logger.error('sign out error', err))

    }
  }
github dabit3 / full-stack-serverless-code / custom-authentication / src / Profile.js View on Github external
function signOut() {
    Auth.signOut()
      .catch(err => console.log('error signing out: ', err))
  }
  if (user) {
github pjay79 / BarsAppAmplify / app / features / App / Bars / More / MoreScreen.js View on Github external
signOut = async () => {
    try {
      this.setState({ loading: true });
      const { navigation } = this.props;
      await Auth.signOut();
      navigation.navigate('Auth');
    } catch (error) {
      console.log(error);
    }
  };
github ionic-team / starters / ionic-angular / official / aws / src / pages / settings / settings.ts View on Github external
logout() {
    Auth.signOut()
      .then(() => this.app.getRootNav().setRoot(LoginPage));
  }
github codexstanford / techlist-frontend-web / src / store / utils / auth-client.js View on Github external
function logout() {
  window.localStorage.removeItem(LOCAL_STORAGE_KEY);
  return Auth.signOut();
}
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / Greetings.jsx View on Github external
signOut() {
        this.googleSignOut();
        this.facebookSignOut();
        Auth.signOut()
            .then(() => this.changeState('signedOut'))
            .catch(err => { logger.error(err); this.error(err); });
    }