Use consts
This commit is contained in:
parent
73f2be72ce
commit
29e95d3d9e
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
Loading…
Reference in New Issue