YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: simplified team invite — single web URL, no passphrase needed
Louis Beaumont44a19b73f987
diff --git a/apps/screenpipe-app-tauri/components/settings/team-section.tsx b/apps/screenpipe-app-tauri/components/settings/team-section.tsxindex 31dbb59cc..aa9927f45 100644--- a/apps/screenpipe-app-tauri/components/settings/team-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/team-section.tsx@@ -98,10 +98,22 @@ export function TeamSection() {const teamId = parsed.searchParams.get("team_id");const inviteToken = parsed.searchParams.get("invite_token");const claimToken = parsed.searchParams.get("claim");- const legacyKey = parsed.searchParams.get("key");+ const base64Key = parsed.searchParams.get("key");- if (teamId && claimToken) {- // new secure flow: need passphrase from user+ if (teamId && base64Key && !claimToken) {+ // new direct key flow (from web invite link)+ setJoining(true);+ await team.joinTeam(teamId, {+ base64Key: decodeURIComponent(base64Key),+ inviteToken: inviteToken ? decodeURIComponent(inviteToken) : undefined,+ });+ posthog.capture("team_joined", { source: "web_invite" });+ toast({+ title: "joined team!",+ description: "you are now a team member",+ });+ } else if (teamId && claimToken) {+ // passphrase flow (backwards compat)setPendingJoin({teamId,claimToken: decodeURIComponent(claimToken),@@ -111,11 +123,11 @@ export function TeamSection() {title: "enter passphrase to join team",description: "ask the admin for the passphrase they received when creating the invite",});- } else if (teamId && legacyKey) {+ } else if (teamId && base64Key) {// legacy flow: raw key in URL (old invite links)setJoining(true);await team.joinTeam(teamId, {- legacyBase64Key: decodeURIComponent(legacyKey),+ legacyBase64Key: decodeURIComponent(base64Key),inviteToken: inviteToken ? decodeURIComponent(inviteToken) : undefined,});posthog.capture("team_joined", { source: "deep_link_legacy" });@@ -171,32 +183,32 @@ export function TeamSection() {const teamId = parsed.searchParams.get("team_id");const inviteToken = parsed.searchParams.get("invite_token");const claimToken = parsed.searchParams.get("claim");- const legacyKey = parsed.searchParams.get("key");+ const base64Key = parsed.searchParams.get("key");if (!teamId) throw new Error("invalid invite link — missing team_id");- if (claimToken) {- // new secure flow: prompt for passphrase- setPendingJoin({- teamId,- claimToken: decodeURIComponent(claimToken),+ if (base64Key && !claimToken) {+ // new direct key flow+ setJoining(true);+ await team.joinTeam(teamId, {+ base64Key: decodeURIComponent(base64Key),inviteToken: inviteToken ? decodeURIComponent(inviteToken) : undefined,});+ posthog.capture("team_joined", { source: "web_invite_pasted" });setInviteInput("");setShowJoinInput(false);- } else if (legacyKey) {- // legacy flow: raw key in URL- setJoining(true);- await team.joinTeam(teamId, {- legacyBase64Key: decodeURIComponent(legacyKey),+ toast({ title: "joined team!" });+ } else if (claimToken) {+ // passphrase flow (backwards compat)+ setPendingJoin({+ teamId,+ claimToken: decodeURIComponent(claimToken),inviteToken: inviteToken ? decodeURIComponent(inviteToken) : undefined,});- posthog.capture("team_joined", { source: "invite_link_legacy" });setInviteInput("");setShowJoinInput(false);- toast({ title: "joined team!" });} else {- throw new Error("invalid invite link — missing claim or key parameter");+ throw new Error("invalid invite link — missing key or claim parameter");}} catch (err: any) {toast({@@ -464,7 +476,7 @@ export function TeamSection() {{showJoinInput ? (<div className="flex gap-2"><Input- placeholder="screenpipe://join-team?team_id=...&claim=..."+ placeholder="screenpipe://join-team?team_id=...&key=..."value={inviteInput}onChange={(e) => setInviteInput(e.target.value)}onKeyDown={(e) => e.key === "Enter" && handleJoinFromLink()}@@ -548,7 +560,7 @@ export function TeamSection() {</h3></div><p className="text-xs text-muted-foreground mb-2">- share this link with your teammate — it does not contain the encryption key+ share this link with your teammate — the encryption key is embedded in the URL fragment and never reaches the server</p><div className="flex gap-2 items-stretch"><Input@@ -564,33 +576,6 @@ export function TeamSection() {)}</Button></div>- {team.invitePassphrase && (- <div className="mt-3 p-3 rounded-md bg-muted/50 border">- <p className="text-xs font-medium mb-1 flex items-center gap-1">- <Lock className="h-3 w-3" />- passphrase (share separately — verbally or via secure channel)- </p>- <div className="flex items-center gap-2">- <code className="text-lg font-bold tracking-widest select-all">- {team.invitePassphrase}- </code>- <Button- variant="ghost"- size="sm"- className="h-7"- onClick={async () => {- await navigator.clipboard.writeText(team.invitePassphrase!);- toast({ title: "passphrase copied" });- }}- >- <Copy className="h-3 w-3" />- </Button>- </div>- <p className="text-[10px] text-muted-foreground mt-1">- your teammate will need this to decrypt the team encryption key- </p>- </div>- )}</Card>)}diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-team.ts b/apps/screenpipe-app-tauri/lib/hooks/use-team.tsindex 07b78483d..4f5c9c74f 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-team.ts+++ b/apps/screenpipe-app-tauri/lib/hooks/use-team.ts@@ -150,9 +150,8 @@ export function useTeam() {teamKeyRef.current = key;// generate invite link if admin and has key- // the invite link NO LONGER contains the raw encryption key- // instead: key is wrapped with a passphrase, uploaded to server as a one-time claim- // admin shares passphrase separately via secure channel+ // the invite is now a web URL with the AES key in the URL fragment+ // (fragment is never sent to the server)let inviteLink: string | null = null;let invitePassphrase: string | null = null;if (data.role === "admin" && key) {@@ -169,24 +168,11 @@ export function useTeam() {if (tokenRes.ok) {const tokenData = await tokenRes.json();- // 2. wrap key with passphrase and upload to server- const passphrase = generatePassphrase();- const wrapped = await wrapKeyWithPassphrase(key, passphrase);-- const claimRes = await fetch(`${API}/key-claim`, {- method: "POST",- headers: headers(),- body: JSON.stringify({- invite_token: tokenData.invite_token,- ...wrapped,- }),- });-- if (claimRes.ok) {- const claimData = await claimRes.json();- inviteLink = `screenpipe://join-team?team_id=${data.team.id}&invite_token=${tokenData.invite_token}&claim=${claimData.claim_token}`;- invitePassphrase = passphrase;- }+ // 2. export key to base64 and build web URL with key in fragment+ const base64Key = await exportTeamKey(key);+ inviteLink = `https://screenpi.pe/join/${tokenData.invite_token}#key=${encodeURIComponent(base64Key)}`;+ // no passphrase needed in new flow+ invitePassphrase = null;}} catch {// invite generation failed — user can retry@@ -295,6 +281,7 @@ export function useTeam() {async (teamId: string,opts: {+ base64Key?: string;claimToken?: string;passphrase?: string;legacyBase64Key?: string;@@ -305,11 +292,14 @@ export function useTeam() {let key: CryptoKey;- if (opts.legacyBase64Key) {+ if (opts.base64Key) {+ // direct key flow (new web invite — key in URL fragment)+ key = await importTeamKey(opts.base64Key);+ } else if (opts.legacyBase64Key) {// legacy flow: raw key in URL (old invite links)key = await importTeamKey(opts.legacyBase64Key);} else if (opts.claimToken && opts.passphrase) {- // new flow: fetch wrapped key from server, unwrap with passphrase+ // passphrase flow: fetch wrapped key from server, unwrap with passphrase (backwards compat)const claimRes = await fetch(`${API}/key-claim/${encodeURIComponent(opts.claimToken)}`,{ headers: headers() }