mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
do not refresh token when enter verify email / reset password / oauth 2.0 callback page
This commit is contained in:
+23
-1
@@ -46,6 +46,28 @@ const userStore = useUserStore();
|
|||||||
const tokensStore = useTokensStore();
|
const tokensStore = useTokensStore();
|
||||||
const exchangeRatesStore = useExchangeRatesStore();
|
const exchangeRatesStore = useExchangeRatesStore();
|
||||||
|
|
||||||
|
const initialRoutePath: string = (() => {
|
||||||
|
if (!window.location.hash) {
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
const hash = window.location.hash;
|
||||||
|
const hashIndex = hash.indexOf('#/');
|
||||||
|
|
||||||
|
if (hashIndex < 0) {
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
const routePath = hash.substring(hashIndex + 1);
|
||||||
|
const queryIndex = routePath.indexOf('?');
|
||||||
|
|
||||||
|
if (queryIndex < 0) {
|
||||||
|
return routePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return routePath.substring(0, queryIndex);
|
||||||
|
})();
|
||||||
|
|
||||||
const showNotification = ref<boolean>(false);
|
const showNotification = ref<boolean>(false);
|
||||||
|
|
||||||
const currentNotificationContent = computed<string | null>(() => rootStore.currentNotification);
|
const currentNotificationContent = computed<string | null>(() => rootStore.currentNotification);
|
||||||
@@ -84,7 +106,7 @@ settingsStore.updateLocalizedDefaultSettings(localeDefaultSettings);
|
|||||||
|
|
||||||
setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor);
|
setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor);
|
||||||
|
|
||||||
if (isUserLogined()) {
|
if (isUserLogined() && initialRoutePath !== '/verify_email' && initialRoutePath !== '/resetpassword' && initialRoutePath !== '/oauth2_callback') {
|
||||||
if (!settingsStore.appSettings.applicationLock || isUserUnlocked()) {
|
if (!settingsStore.appSettings.applicationLock || isUserUnlocked()) {
|
||||||
// refresh token if user is logined
|
// refresh token if user is logined
|
||||||
tokensStore.refreshTokenAndRevokeOldToken().then(response => {
|
tokensStore.refreshTokenAndRevokeOldToken().then(response => {
|
||||||
|
|||||||
Reference in New Issue
Block a user