How to use the js-cookie.remove function in js-cookie

To help you get started, we’ve selected a few js-cookie 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 FlowzPlatform / website-builder / src / views / UserDashboard.vue View on Github external
}).then(() => {
				localStorage.removeItem('current_sub_id')
				this.$session.remove('username')
				let location = psl.parse(window.location.hostname)
				location = location.domain === null ? location.input : location.domain
				Cookies.remove('auth_token', {domain: location})
				Cookies.remove('email', {domain: location})
				Cookies.remove('userDetailId', {domain: location})
				Cookies.remove('subscriptionId', {domain: location})

				this.isLoggedIn = false
				// this.$router.push('/login');
				window.location = '/login'
			}).catch(() => {
				// this.$message({
github getsentry / sentry / tests / js / spec / views / stream / stream.spec.jsx View on Github external
afterEach(function() {
      Cookies.remove('realtimeActive');
    });
github Perye / dokit / dokit-front / src / views / login.vue View on Github external
rememberMe: this.loginForm.rememberMe,
          code: this.loginForm.code,
          uuid: this.loginForm.uuid
        }
        if (user.password !== this.cookiePass) {
          user.password = encrypt(user.password)
        }
        if (valid) {
          this.loading = true
          if (user.rememberMe) {
            Cookies.set('username', user.username, { expires: Config.passCookieExpires })
            Cookies.set('password', user.password, { expires: Config.passCookieExpires })
            Cookies.set('rememberMe', user.rememberMe, { expires: Config.passCookieExpires })
          } else {
            Cookies.remove('username')
            Cookies.remove('password')
            Cookies.remove('rememberMe')
          }
          this.$store.dispatch('Login', user).then(() => {
            this.loading = false
            this.$router.push({ path: this.redirect || '/' })
          }).catch(() => {
            this.loading = false
            this.getCode()
          })
        } else {
          console.log('error submit!!')
          return false
        }
      })
    }
github ReactTraining / react-router-5-course / src / utils / AuthUser.js View on Github external
function logout() {
    Cookies.remove(cookieName)
    setLogged(false)
  }
github 1ven / do / client / containers / pages / IndexPage.js View on Github external
handleGroupTitleClick(groupTitle, isActive) {
    const name = `${groupTitle}_accordion_hidden`;
    if (!isActive) {
      cookie.set(name, true);
    } else {
      cookie.remove(name);
    }
  }
github bounswe / bounswe2018group3 / app / frontend / robin / src / pages / homepage / components / navbar2 / index.js View on Github external
handleLogout(e){
    e.preventDefault();
    Cookies.remove("token");
    this.setState({redirect: "/login"});
  }
github ubyssey / dispatch / dispatch / static / manager / src / js / reducers / AuthReducer.js View on Github external
reducer.handle(rejected(types.AUTH.VERIFY_TOKEN), (state, action) => {
  const validToken = R.path(['response', 'valid_token'], action)

  if (validToken === false) {
    Cookies.remove('token')
    Cookies.remove('email')

    return initialState
  }

  return state
})
github zuiidea / antd-admin / mock / app.js View on Github external
'POST /api/logout' (req, res) {
    Cookie.remove('user_session', { path: '/' })
    Cookie.remove('user_name', { path: '/' })
    res.json({
      success: true,
      message: '退出成功',
    })
  },
}
github SolidZORO / leaa / packages / leaa-www / src / utils / auth.util.ts View on Github external
const removeAuthInfo = (ctx?: NextPageContext): boolean => {
  if (isServer) {
    nookies.destroy(ctx, AUTH_INFO);
  }

  if (isClient) {
    Cookies.remove(AUTH_INFO);
  }

  return true;
};
github bounswe / bounswe2018group3 / app / frontend / robin / src / pages / homepage / components / navbar / index.js View on Github external
handleLogout(e){
    e.preventDefault();
    Cookies.remove("token");
    this.setState({redirect: "/login"});
  }