forked from WikiDeck/wikideck
[mobile-android] SSO deep-link return path, dark system bars (#8) #41
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#1e1e2e</color>
|
||||
<color name="colorPrimaryDark">#11111b</color>
|
||||
<color name="colorAccent">#cba6f7</color>
|
||||
<!-- Behind the status and navigation bars: matches the dark app header. -->
|
||||
<color name="wikideckChrome">#11111b</color>
|
||||
</resources>
|
||||
@@ -13,6 +13,9 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:background">@null</item>
|
||||
<!-- Dark behind the status/navigation bars (edge-to-edge margins) to match the app chrome. -->
|
||||
<item name="android:windowBackground">@color/wikideckChrome</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// On the web it does nothing: relative `/api/...` requests keep going to the serving origin.
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { App } from '@capacitor/app';
|
||||
import { Browser } from '@capacitor/browser';
|
||||
import './native.css';
|
||||
|
||||
/** True inside the Android/iOS app shell. Use it to hide desktop-only features such as RandomX mining. */
|
||||
@@ -84,4 +85,13 @@ if (isNativeApp()) {
|
||||
if (parsed.protocol !== 'dev.eom.wikideck:') return;
|
||||
if (deepLinkHandlers.size) deepLinkHandlers.forEach(h => h(parsed)); else pendingDeepLink = parsed;
|
||||
});
|
||||
// eom.dev SSO (src/auth, sso team). Imported lazily so this module still runs before anything else.
|
||||
// Login opens Dex in the system browser (Custom Tab); the redirect comes back as a deep link.
|
||||
const auth = import('./auth/session.ts');
|
||||
void auth.then(({ setNativeBrowser }) => setNativeBrowser(Browser));
|
||||
onDeepLink(url => {
|
||||
void auth.then(({ isCallback, completeLogin }) => {
|
||||
if (isCallback(url.href)) return completeLogin(url.href);
|
||||
}).catch(error => console.warn('[native] SSO callback failed', error));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user