Skip to content

Commit cd0626a

Browse files
committed
chore: fix login issue
1 parent be7b7fa commit cd0626a

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

platforms/eReputation/client/src/pages/deeplink-login.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,24 @@ export default function DeeplinkLogin() {
4242
const appVersion = params.get('appVersion');
4343

4444
if (!ename || !session || !signature) {
45-
// Add a small delay to allow URL to fully parse before showing error
45+
// Add a small delay to allow URL to fully parse before deciding
4646
await new Promise(resolve => setTimeout(resolve, 500));
4747
// Re-check one more time after delay
48-
const finalParams = new URLSearchParams(window.location.search || (window.location.hash.includes('?') ? window.location.hash.substring(window.location.hash.indexOf('?') + 1) : '') || '');
48+
const finalParams = new URLSearchParams(
49+
window.location.search ||
50+
(window.location.hash.includes('?')
51+
? window.location.hash.substring(window.location.hash.indexOf('?') + 1)
52+
: '') ||
53+
''
54+
);
4955
ename = finalParams.get('ename') || ename;
5056
session = finalParams.get('session') || session;
5157
signature = finalParams.get('signature') || signature;
52-
53-
if (!ename || !session || !signature) {
54-
setError("Missing required authentication parameters");
55-
setIsLoading(false);
56-
return;
58+
59+
if (!ename || !session || !signature) {
60+
// If still missing, silently redirect to home/login to avoid flashing error
61+
window.location.href = "/";
62+
return;
5763
}
5864
}
5965

platforms/group-charter-manager/src/app/deeplink-login/page.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,23 @@ export default function DeeplinkLogin() {
4343
const appVersion = params.get('appVersion');
4444

4545
if (!ename || !session || !signature) {
46-
// Add a small delay to allow URL to fully parse before showing error
46+
// Add a small delay to allow URL to fully parse before deciding
4747
await new Promise(resolve => setTimeout(resolve, 500));
4848
// Re-check one more time after delay
49-
const finalParams = new URLSearchParams(window.location.search || (window.location.hash.includes('?') ? window.location.hash.substring(window.location.hash.indexOf('?') + 1) : '') || '');
49+
const finalParams = new URLSearchParams(
50+
window.location.search ||
51+
(window.location.hash.includes('?')
52+
? window.location.hash.substring(window.location.hash.indexOf('?') + 1)
53+
: '') ||
54+
'',
55+
);
5056
ename = finalParams.get('ename') || ename;
5157
session = finalParams.get('session') || session;
5258
signature = finalParams.get('signature') || signature;
5359

5460
if (!ename || !session || !signature) {
55-
setError("Missing required authentication parameters");
56-
setIsLoading(false);
61+
// If still missing, silently redirect to home/login to avoid flashing error
62+
window.location.href = "/";
5763
return;
5864
}
5965
}

0 commit comments

Comments
 (0)