Pickle Systems
connectionsLogin
Roblox
connectionsLogin

Admin view

This surface is designed for hub owners and members. Admins can audit connections from Admin pages.
async ({ sess, ctx }) => { const uid = String(sess?.userId || ''); const flash = String(req.query?.roblox || '').trim().toLowerCase(); const identities = uid ? await ctx?.storage?.users?.listLinkedIdentities(uid, 'roblox').catch(() => []) : []; const userLinked = Array.isArray(identities) && identities.length ? identities[0] : null; const accountSnapshot = uid ? await getAccountHubSnapshotForUser(ctx?.db, uid).catch(() => null) : null; const accountRoblox = Array.isArray(accountSnapshot?.activeIdentities) ? accountSnapshot.activeIdentities.find((row) => String(row?.provider || '').trim().toLowerCase() === 'roblox' || String(row?.provider || '').trim().toLowerCase() === 'roblox_platform') : null; const current = accountRoblox || userLinked || null; const connectedLogin = String(current?.login || current?.display || 'Roblox').trim(); const connectedDisplay = String(current?.display || current?.login || 'Roblox').trim(); const connectedProviderUserId = String(current?.provider_user_id || current?.providerUserId || userLinked?.providerUserId || userLinked?.provider_user_id || '').trim(); const connectedIdentityType = String(current?.identity_type || current?.identityType || '').trim().toLowerCase(); const canDisconnect = !!current && connectedIdentityType !== 'origin'; const flashHtml = flash === 'removed' ? '
Roblox disconnected
Roblox was removed from this Pickle Systems account. Your Hub and other connections were kept.
' : flash === 'origin_blocked' ? '
Roblox cannot be disconnected here
This Roblox identity is marked as a sign-in origin. Add another sign-in method first or contact support before removing it.
' : flash === 'account_missing' ? '
Account setup needed
Sign in again, then return to this page to manage Roblox.
' : flash === 'error' ? '
Roblox update failed
Roblox could not be updated right now.
' : ''; const connectedHtml = current ? `
Roblox connected
Connected as @${esc(connectedLogin || 'Roblox')}. This username is used by the Roblox experience for giveaway entries and Hub identity.
` : ''; const detailsHtml = current ? `
Roblox details
Username
@${esc(connectedLogin || 'Roblox')}
Used for Roblox entries and in-experience board checks.
Display name
${esc(connectedDisplay || connectedLogin || 'Roblox')}
Shown on your Hub and Roblox cards.
Roblox ID
${esc(connectedProviderUserId || 'Saved')}
Internal Roblox user ID used by the experience.
Reconnect Roblox ${canDisconnect ? `
` : `Disconnect is unavailable because Roblox is marked as a sign-in origin.`}
` : ''; return `
Roblox
Connect your Roblox account so Pickle Systems can use your Roblox username in the experience, verify Streamer boards, and show Roblox on your Hub.
${flashHtml} ${connectedHtml}
Login / Connect
${oauthConfigured ? `
This links Roblox to your currently signed-in Pickle Systems account and keeps your existing Hub, posts, Twitch/YouTube connections, and responses intact.
Roblox callback URL for the Roblox app settings: ${esc(robloxCallbackUrl)}
` : `
Roblox sign-in is not configured yet. Add the Roblox OAuth client id/secret and callback URL ${esc(robloxCallbackUrl)}, then restart Pickle Systems.
`}
${detailsHtml}
Roblox giveaway mode
When this is connected, your Roblox experience can resolve your Hub from your Roblox user ID. Players joining from the experience are entered as their Roblox username.
Donate system
Donation pages live on r.donate.${esc(base)}. Roblox login is the recommended way to claim and verify a donation profile.
`; }