fix(native): SSO in the Android app survives Android ending the app while the browser is open

A Samsung phone may end the app while the sign-in runs in the browser. The browser's return then started the app anew without the call that waited for it, the first page load failed while the network was still held back, and the user came back to 'server not reachable' and then to the sign-in page, in a loop. The return is now kept natively and redeemed by the sign-in page with the verifier kept until then, and a page that failed on the network is loaded once more before the app gives up.
This commit is contained in:
Maurice
2026-11-12 08:42:17 +01:00
parent cc5eca5553
commit ec08032e98
7 changed files with 283 additions and 8 deletions
+6
View File
@@ -46,6 +46,12 @@ export interface TrekShellPlugin {
* user closes the browser.
*/
authenticate(options: { url: string; callbackScheme: string }): Promise<{ url: string }>;
/**
* Android: a return to the sign-in scheme that found no authenticate() call
* waiting, because the app was started anew meanwhile. Handed out once, and
* only for two minutes, as long as the server keeps its code. Not in iOS builds, nor in Android builds before 5.1.4.
*/
takeAuthCallback(): Promise<{ url: string | null }>;
/** iOS: stores the server's start page for a cold start without network. */
refreshOfflineCopy(): Promise<{ saved: boolean }>;
/** iOS: loads that copy under the server's origin. False when there is none. */