feat(web): add authenticated Community (Let's Chat) button for members #315
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-329-community-button"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
BUNYIP-329: surface Let's Chat as an authenticated "Community" button in the Bunyip front end. Members get a dashboard button that drops them into the team Let's Chat instance already logged in, with no separate sign-in.
How it authenticates
Let's Chat is already registered as an OIDC client of bunyip-api (migration
20260618032217_register_lets_chat_oidc_client.sql, callbackhttps://chat.a8n.systems/auth/bunyip/callback). So this is the same single-sign-in bridge the app tiles use: opening the instance runs its OIDC client against bunyip-api, and the member's existing OP session logs them in. No token minting in bunyip-web.Changes
BUNYIP_COMMUNITY_URL): the full URL the Community button opens, empty by default. Empty disables the feature (button hidden,/communitysends the user back to the dashboard) so a deploy without Let's Chat never shows a dead link. Point it at the login-init path (e.g.https://chat.a8n.systems/auth/bunyip) so the OIDC flow fires immediately instead of landing on Let's Chat's own login page.GET /community: guards the session, then redirects a member into the configured instance; a non-member is sent to the membership upsell. The routing decision is a purecommunity_redirect_target(member+configured -> Let's Chat; non-member ->/membership; unconfigured ->/dashboard)./communityin a new tab. Hidden for non-members and when unconfigured.Tests
cargo fmt --all --check,cargo clippy -p bunyip-web --all-targets(clean), andcargo test -p bunyip-web(52 passing) all green. New unit tests cover the three redirect branches (member into Let's Chat, non-member upsell, unconfigured fallback), which is the authenticated-redirect behavior AC3 asks for.Assumptions / scope
BUNYIP_COMMUNITY_URLconfig rather than hardcoded, since it is an ops/infra detail; the/auth/bunyipvalue follows the Passport callback convention in the existing migration.Closes BUNYIP-329.