mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
fix: preserve + chars in deep link URL params for crypto links
URLSearchParams decodes + as space, breaking base64-encoded crypto deep links (ss://, vless://, etc). Use raw param extraction with manual decoding to preserve + characters.
This commit is contained in:
@@ -61,9 +61,17 @@ export default function DeepLinkRedirect() {
|
|||||||
const logoLetter = branding?.logo_letter || import.meta.env.VITE_APP_LOGO || 'V';
|
const logoLetter = branding?.logo_letter || import.meta.env.VITE_APP_LOGO || 'V';
|
||||||
const logoUrl = branding ? brandingApi.getLogoUrl(branding) : null;
|
const logoUrl = branding ? brandingApi.getLogoUrl(branding) : null;
|
||||||
|
|
||||||
|
// Get raw URL parameter preserving '+' chars (URLSearchParams decodes '+' as space, breaking base64 in crypto links)
|
||||||
|
const getRawParam = (key: string) => {
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const raw = params.get(key);
|
||||||
|
if (!raw) return '';
|
||||||
|
return decodeURIComponent(raw.replace(/ /g, '+'));
|
||||||
|
};
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
const deepLink = searchParams.get('url') || searchParams.get('deeplink') || '';
|
const deepLink = getRawParam('url') || getRawParam('deeplink') || '';
|
||||||
const subscriptionUrl = searchParams.get('sub') || '';
|
const subscriptionUrl = getRawParam('sub') || '';
|
||||||
const appParam = searchParams.get('app') || '';
|
const appParam = searchParams.get('app') || '';
|
||||||
|
|
||||||
// Detect app from deep link
|
// Detect app from deep link
|
||||||
|
|||||||
Reference in New Issue
Block a user