From 0f5e1b3f7cc8927e1049fd4d92cf22f38d0f6b8f Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sun, 1 Nov 2026 14:19:24 +0000 Subject: [PATCH] feat: import OpenProfile on connect --- apps/pwa/package.json | 2 +- apps/pwa/src/routes/coinpay.mjs | 9 +++++++++ apps/pwa/src/routes/pages.mjs | 3 ++- bun.lock | 6 ++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/pwa/package.json b/apps/pwa/package.json index ab5eb799..2874c9db 100644 --- a/apps/pwa/package.json +++ b/apps/pwa/package.json @@ -16,7 +16,7 @@ "@profullstack/key-rotation": "0.1.0", "@profullstack/footer": "latest", "@profullstack/libsql-pg": "^0.1.4", - "@profullstack/profile": "0.1.6", + "@profullstack/profile": "0.1.7", "@simplewebauthn/browser": "^14.0.0", "@simplewebauthn/server": "^14.0.3", "cookie-parser": "^1.4.7", diff --git a/apps/pwa/src/routes/coinpay.mjs b/apps/pwa/src/routes/coinpay.mjs index 0e4add15..de76b022 100644 --- a/apps/pwa/src/routes/coinpay.mjs +++ b/apps/pwa/src/routes/coinpay.mjs @@ -5,6 +5,8 @@ import { config } from "../config.mjs"; import { token } from "../lib/crypto.mjs"; import { createSession, setCeremony, getCeremony, clearCeremony, takeNext } from "../lib/session.mjs"; import { userByCoinpay, createUserForCoinpay } from "../lib/users.mjs"; +import { profiles } from "../lib/profile.mjs"; +import { saveOpenProfileContact } from "@profullstack/profile"; export const coinpayRouter = Router(); @@ -59,6 +61,13 @@ coinpayRouter.get("/auth/coinpay/callback", async (req, res) => { let user = await userByCoinpay(sub); if (!user) user = await createUserForCoinpay(sub, info.name || info.username); + if (typeof info.openprofile_url === "string") { + try { + await saveOpenProfileContact(profiles, String(user.id), info.openprofile_url); + } catch (e) { + console.warn("[coinpay] OpenProfile import skipped:", e instanceof Error ? e.message : e); + } + } await createSession(res, user.id); res.redirect(takeNext(req, res) || "/"); } catch (e) { diff --git a/apps/pwa/src/routes/pages.mjs b/apps/pwa/src/routes/pages.mjs index 4a888554..8c90625f 100644 --- a/apps/pwa/src/routes/pages.mjs +++ b/apps/pwa/src/routes/pages.mjs @@ -336,10 +336,11 @@ pagesRouter.get("/settings", requireAuth, async (req, res) => {
Your details
${csrfInput(req)} - ${renderProfileFields({ values: profileValues, required: ["first_name", "last_name"], idPrefix: "account-" })} + ${renderProfileFields({ values: profileValues, required: ["first_name", "last_name"], idPrefix: "account-", importOpenProfile: true })}
+
API keys

A person key acts as you; logicsrc login makes one for you. A machine key is for a deploy box or CI: one team, the vaults you list, read-only unless you say otherwise, its own identity key. After the box runs one command with it, grant it a vault from the vault page or with logicsrc teams grant <team> <project> <env> --key <name>.

diff --git a/bun.lock b/bun.lock index 0a5e0d38..58036afe 100644 --- a/bun.lock +++ b/bun.lock @@ -87,7 +87,7 @@ "@profullstack/footer": "latest", "@profullstack/key-rotation": "0.1.0", "@profullstack/libsql-pg": "^0.1.4", - "@profullstack/profile": "0.1.6", + "@profullstack/profile": "0.1.7", "@simplewebauthn/browser": "^14.0.0", "@simplewebauthn/server": "^14.0.3", "cookie-parser": "^1.4.7", @@ -773,7 +773,9 @@ "@profullstack/logicsrc-mcp": ["@profullstack/logicsrc-mcp@workspace:packages/logicsrc-mcp"], - "@profullstack/profile": ["@profullstack/profile@0.1.6", "", { "peerDependencies": { "@libsql/client": ">=0.6.0", "postgres": "^3.4.0", "react": ">=18" }, "optionalPeers": ["@libsql/client", "postgres", "react"], "bin": { "profile": "src/cli.js" } }, "sha512-xkn0P3ANz151QJdlBwcBXkHk813qW9qAmuTZKcuvpEZYkyHDC9J9KfvpVSRepfjECzz4ONGHWO5Zwc4BHpfK8g=="], + "@profullstack/openprofile": ["@profullstack/openprofile@0.2.0", "", {}, "sha512-cdFsBbfRXurvy5KqHDNcKXxurK2s/YlfVgnILFRpVl2hq3860rExqDee8IfsFGxw5cPdqGv2fxUxtek1Xy2U5Q=="], + + "@profullstack/profile": ["@profullstack/profile@0.1.7", "", { "dependencies": { "@profullstack/openprofile": "^0.2.0" }, "peerDependencies": { "@libsql/client": ">=0.6.0", "postgres": "^3.4.0", "react": ">=18" }, "optionalPeers": ["@libsql/client", "postgres", "react"], "bin": { "profile": "src/cli.js" } }, "sha512-N7UkypkkY2JkSBKzmdmyy6+DCoxI048qUZQksEjSRwSIyy4mjU9H1qW4yhZD+LJBhTEupgJv//Uxwhiy2FuGmA=="], "@profullstack/referrals": ["@profullstack/referrals@0.1.0", "", { "peerDependencies": { "react": ">=18" }, "optionalPeers": ["react"] }, "sha512-u66SdBVpsv3kc0N+NWISPoYD5vjCERyv5wfD07iSkZwQeC2IA+ihX5jNA4e7Xr+Y4AUvxLycG+3b4VaROqzgRg=="],