fix(stage-pocket,stage-server): correct Android deep link scheme (#1794)
This commit is contained in:
@@ -11,7 +11,7 @@ function getOriginFromUrl(url: string): string | undefined {
|
||||
|
||||
const TRUSTED_EXACT_ORIGINS = [
|
||||
'capacitor://localhost', // Capacitor mobile (iOS)
|
||||
'ai.moeru.airi_pocket://links', // Android deep link
|
||||
'ai.moeru.airi-pocket://links', // Android deep link
|
||||
'https://airi.moeru.ai', // Production
|
||||
]
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<!-- Custom Protocol Configuration -->
|
||||
<data
|
||||
android:scheme="ai.moeru.airi_pocket"
|
||||
android:scheme="ai.moeru.airi-pocket"
|
||||
android:host="links" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -12,7 +12,7 @@ export function installDeepLinks(router: Router): void {
|
||||
|
||||
try {
|
||||
const url = new URL(event.url)
|
||||
if (url.host === 'localhost' && url.pathname === '/auth/callback') {
|
||||
if (url.host === 'links' && url.pathname === '/auth/callback') {
|
||||
const code = url.searchParams.get('code')
|
||||
const state = url.searchParams.get('state')
|
||||
if (!code || !state) {
|
||||
|
||||
@@ -30,7 +30,7 @@ function getRedirectOrigin() {
|
||||
|
||||
// 2. Handle Android Native (Capacitor) environment
|
||||
if (isAndroidNative) {
|
||||
return 'ai.moeru.airi_pocket://links'
|
||||
return 'ai.moeru.airi-pocket://links'
|
||||
}
|
||||
|
||||
// 3. Handle standard browser environment
|
||||
|
||||
Reference in New Issue
Block a user