WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit df23cb8

Browse files
committed
do not refresh token when enter verify email / reset password / oauth 2.0 callback page
1 parent 87a21a1 commit df23cb8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/DesktopApp.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,28 @@ const userStore = useUserStore();
4646
const tokensStore = useTokensStore();
4747
const exchangeRatesStore = useExchangeRatesStore();
4848
49+
const initialRoutePath: string = (() => {
50+
if (!window.location.hash) {
51+
return '/';
52+
}
53+
54+
const hash = window.location.hash;
55+
const hashIndex = hash.indexOf('#/');
56+
57+
if (hashIndex < 0) {
58+
return '/';
59+
}
60+
61+
const routePath = hash.substring(hashIndex + 1);
62+
const queryIndex = routePath.indexOf('?');
63+
64+
if (queryIndex < 0) {
65+
return routePath;
66+
}
67+
68+
return routePath.substring(0, queryIndex);
69+
})();
70+
4971
const showNotification = ref<boolean>(false);
5072
5173
const currentNotificationContent = computed<string | null>(() => rootStore.currentNotification);
@@ -84,7 +106,7 @@ settingsStore.updateLocalizedDefaultSettings(localeDefaultSettings);
84106
85107
setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor);
86108
87-
if (isUserLogined()) {
109+
if (isUserLogined() && initialRoutePath !== '/verify_email' && initialRoutePath !== '/resetpassword' && initialRoutePath !== '/oauth2_callback') {
88110
if (!settingsStore.appSettings.applicationLock || isUserUnlocked()) {
89111
// refresh token if user is logined
90112
tokensStore.refreshTokenAndRevokeOldToken().then(response => {

0 commit comments

Comments
 (0)