Skip to content

Commit 6bb7a51

Browse files
authored
Added a Return to Schuly deep-link button on the info page for app clients (#73)
1 parent 3780611 commit 6bb7a51

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

keycloakify/src/login/pages/info/Page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ export function Page() {
6262
return null;
6363
}
6464

65+
const baseUrl = kcContext.client.baseUrl;
66+
// App deep link (e.g. schuly://): after a cross-browser action
67+
// like email verification there's no flow to resume in this
68+
// browser, so send the user straight back to the app.
69+
if (baseUrl !== undefined && !/^https?:\/\//i.test(baseUrl)) {
70+
return (
71+
<Button type="button" className="w-full">
72+
<a href={baseUrl}>Return to Schuly</a>
73+
</Button>
74+
);
75+
}
76+
6577
if (kcContext.pageRedirectUri) {
6678
return (
6779
<Button type="button" className="flex ms-auto">

realms/schuly-realm.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
"clientId": "schuly-app",
277277
"name": "Schuly App",
278278
"description": "Public OIDC client for the Schuly mobile app (PKCE).",
279+
"baseUrl": "schuly://",
279280
"enabled": true,
280281
"publicClient": true,
281282
"standardFlowEnabled": true,

0 commit comments

Comments
 (0)