Night 1: Android SSO deep-link return path and dark system bars (#41)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #41.
This commit is contained in:
2026-11-17 05:45:40 +00:00
co-authored by Claude Opus 5.5
parent 52c40bd3e3
commit 4bbc341bcb
3 changed files with 21 additions and 0 deletions
@@ -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>
+10
View File
@@ -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));
});
}