diff --git a/src/encryptid/server.ts b/src/encryptid/server.ts
index 386f4de..e220439 100644
--- a/src/encryptid/server.ts
+++ b/src/encryptid/server.ts
@@ -4165,11 +4165,16 @@ app.get('/api/invites/identity/:token/info', async (c) => {
if (Date.now() > invite.expiresAt) {
return c.json({ error: 'Invite expired' }, 410);
}
- // Look up OIDC client name if this is a client invite
+ // Look up OIDC client info if this is a client invite
let clientName: string | null = null;
+ let clientAppUrl: string | null = null;
if (invite.clientId) {
const client = await getOidcClient(invite.clientId);
clientName = client?.name || null;
+ // Derive app URL from first redirect URI (strip the callback path)
+ if (client?.redirectUris?.[0]) {
+ try { clientAppUrl = new URL(client.redirectUris[0]).origin; } catch {}
+ }
}
return c.json({
invitedBy: invite.invitedByUsername,
@@ -4178,6 +4183,7 @@ app.get('/api/invites/identity/:token/info', async (c) => {
spaceSlug: invite.spaceSlug,
clientId: invite.clientId,
clientName,
+ clientAppUrl,
});
});
@@ -4774,24 +4780,23 @@ function oidcAcceptPage(token: string): string {
return;
}
- // If this is an OIDC client invite, redirect through the OIDC authorize flow
- if (inviteData.clientId) {
- showStatus('Redirecting to ' + (inviteData.clientName || 'the app') + '...');
- // Store the session token so the OIDC authorize page can use it
- localStorage.setItem('eid_token', sessionToken);
- // Start the OIDC authorize flow — the authorize page will auto-login
- window.location.href = '/oidc/authorize?client_id=' + encodeURIComponent(inviteData.clientId) +
- '&response_type=code&scope=openid+profile+email&redirect_uri=' + encodeURIComponent('auto') +
- '&state=invite_accept';
- return;
- }
-
- // Non-OIDC invite — show success
+ // Show success with link to the app
document.getElementById('authSection').style.display = 'none';
statusEl.style.display = 'none';
- successEl.innerHTML = 'Welcome!
Your invitation has been accepted.' +
- (claimData.spaceSlug ? '
You\\'ve been added to ' + esc(claimData.spaceSlug) + '.' : '') +
- '
Go to rSpace \\u2192';
+
+ const appName = inviteData.clientName || 'rSpace';
+ const appUrl = inviteData.clientAppUrl || 'https://rspace.online';
+
+ if (inviteData.clientId) {
+ successEl.innerHTML = 'You\\u2019re in!
' +
+ 'Your account is set up and you\\u2019ve been granted access to ' + esc(appName) + '.' +
+ '
Go to ' + esc(appName) + ' \\u2192' +
+ '
You\\u2019ll sign in with your passkey when you get there.
'; + } else { + successEl.innerHTML = 'Welcome!