Use consts

This commit is contained in:
Christian Cueni 2021-06-18 09:37:56 +02:00
parent 73f2be72ce
commit 29e95d3d9e
2 changed files with 7 additions and 3 deletions

View File

@ -23,6 +23,7 @@ import roomRoutes from './room.routes';
import store from '@/store/index';
import {LAYOUT_SIMPLE} from '@/router/core.constants';
import {EMAIL_NOT_VERIFIED_STATE, NO_VALID_LICENSE_STATE, SUCCESS_STATE} from "./oauth.names";
const postLoginRederictUrlKey = 'postLoginRedirectionUrl';
@ -81,11 +82,11 @@ const routes = [
path: '/oauth-redirect',
redirect: to => {
switch (to.query.state) {
case 'email_not_verified':
case EMAIL_NOT_VERIFIED_STATE:
return '/verify-email';
case 'no_valid_license':
case NO_VALID_LICENSE_STATE:
return '/license-activation';
case 'success':
case SUCCESS_STATE:
if (window.localStorage && localStorage.getItem(postLoginRederictUrlKey)) {
const redirectUrl = localStorage.getItem(postLoginRederictUrlKey);
localStorage.removeItem(postLoginRederictUrlKey);

View File

@ -0,0 +1,3 @@
export const EMAIL_NOT_VERIFIED_STATE = 'email_not_verified';
export const NO_VALID_LICENSE_STATE = 'no_valid_license';
export const SUCCESS_STATE = 'success';