Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).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({
afterEach(function() {
Cookies.remove('realtimeActive');
});
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
}
})
}
function logout() {
Cookies.remove(cookieName)
setLogged(false)
}
handleGroupTitleClick(groupTitle, isActive) {
const name = `${groupTitle}_accordion_hidden`;
if (!isActive) {
cookie.set(name, true);
} else {
cookie.remove(name);
}
}
handleLogout(e){
e.preventDefault();
Cookies.remove("token");
this.setState({redirect: "/login"});
}
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
})
'POST /api/logout' (req, res) {
Cookie.remove('user_session', { path: '/' })
Cookie.remove('user_name', { path: '/' })
res.json({
success: true,
message: 'ιεΊζε',
})
},
}
const removeAuthInfo = (ctx?: NextPageContext): boolean => {
if (isServer) {
nookies.destroy(ctx, AUTH_INFO);
}
if (isClient) {
Cookies.remove(AUTH_INFO);
}
return true;
};
handleLogout(e){
e.preventDefault();
Cookies.remove("token");
this.setState({redirect: "/login"});
}