From 58222fb82f76e3e88fe6d9db81b4e0a6893d9a59 Mon Sep 17 00:00:00 2001
From: Anthony Ettinger
Date: Sun, 1 Nov 2026 14:19:24 +0000
Subject: [PATCH 1/2] feat: import OpenProfile on connect
---
apps/web/package.json | 2 +-
apps/web/src/routes/coinpay.js | 14 +++++++++++++-
apps/web/src/views/pages.jsx | 3 ++-
bun.lock | 4 ++--
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/apps/web/package.json b/apps/web/package.json
index aad1578..90b4547 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -29,7 +29,7 @@
"@profullstack/notifications": "^0.1.4",
"@profullstack/openprofile": "^0.2.0",
"@profullstack/partners": "0.2.0",
- "@profullstack/profile": "0.1.6",
+ "@profullstack/profile": "0.1.7",
"@profullstack/redeem-credits": "^0.2.0",
"@profullstack/throttle": "^0.4.0",
"@profullstack/webhooks": "0.2.1",
diff --git a/apps/web/src/routes/coinpay.js b/apps/web/src/routes/coinpay.js
index d94f7bf..99f7a58 100644
--- a/apps/web/src/routes/coinpay.js
+++ b/apps/web/src/routes/coinpay.js
@@ -1,4 +1,5 @@
import { getCookie, setCookie } from 'hono/cookie';
+import { saveOpenProfileContact } from '@profullstack/profile';
import {
beginSignIn,
coinpayConfig,
@@ -119,7 +120,18 @@ export function registerCoinpay(app, overrides = null) {
if (!user || c.get('viaKey') || String(user.id) !== String(pending.userId))
return c.redirect(back('/login', 'Sign in first, then connect CoinPay.'), 303);
const r = await store.link(user.id, { sub: who.sub, email: who.email });
- if (r.ok) return c.redirect(back('/settings', 'CoinPay connected.', 'notice'), 303);
+ if (r.ok) {
+ const openprofileUrl = who.userinfo?.openprofile_url;
+ if (typeof openprofileUrl === 'string') {
+ try {
+ const { profiles } = await import('../lib/profile.js');
+ await saveOpenProfileContact(profiles, String(user.id), openprofileUrl);
+ } catch (err) {
+ console.warn('[coinpay] OpenProfile import skipped:', err instanceof Error ? err.message : err);
+ }
+ }
+ return c.redirect(back('/settings', 'CoinPay connected.', 'notice'), 303);
+ }
const why =
r.reason === 'taken'
? 'That CoinPay account is already linked to another nichedb account.'
diff --git a/apps/web/src/views/pages.jsx b/apps/web/src/views/pages.jsx
index 66d9244..34bdc5b 100644
--- a/apps/web/src/views/pages.jsx
+++ b/apps/web/src/views/pages.jsx
@@ -837,11 +837,12 @@ export const Settings = ({
{user.email}. Also at /api/v1/me/profile.
+
{coinpayEnabled() ? (
diff --git a/bun.lock b/bun.lock
index c123f76..f034713 100644
--- a/bun.lock
+++ b/bun.lock
@@ -43,7 +43,7 @@
"@profullstack/notifications": "^0.1.4",
"@profullstack/openprofile": "^0.2.0",
"@profullstack/partners": "0.2.0",
- "@profullstack/profile": "0.1.6",
+ "@profullstack/profile": "0.1.7",
"@profullstack/redeem-credits": "^0.2.0",
"@profullstack/throttle": "^0.4.0",
"@profullstack/webhooks": "0.2.1",
@@ -387,7 +387,7 @@
"@profullstack/partners": ["@profullstack/partners@0.2.0", "", { "dependencies": { "@profullstack/leaderboard": "^0.3.1" } }, "sha512-h8Fal+ZMqpR2xixo8OC/Xb/OXfLXmt2BdBIgohC3tK6U3AkAsDrkUyrlf+DEF8Ut8mptDEjCWDz5EV/dIXBRHw=="],
- "@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/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/redeem-credits": ["@profullstack/redeem-credits@0.2.0", "", { "bin": { "redeem-credits": "dist/cli.js" } }, "sha512-JLowb7mWYfouIK7O522tuPPhvLjQjhdEfm6g3xEYrlNLGzLhrIADDhrYldBlGHfiVBWUFX7wefLuCSLF9fnyog=="],
From 133935909c79fad4b164c07f04551de17c34c463 Mon Sep 17 00:00:00 2001
From: Anthony Ettinger
Date: Sun, 1 Nov 2026 14:22:11 +0000
Subject: [PATCH 2/2] fix: format OpenProfile import wiring
---
apps/web/src/routes/coinpay.js | 7 +++++--
apps/web/src/views/pages.jsx | 8 +++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/apps/web/src/routes/coinpay.js b/apps/web/src/routes/coinpay.js
index 99f7a58..7b13add 100644
--- a/apps/web/src/routes/coinpay.js
+++ b/apps/web/src/routes/coinpay.js
@@ -1,5 +1,5 @@
-import { getCookie, setCookie } from 'hono/cookie';
import { saveOpenProfileContact } from '@profullstack/profile';
+import { getCookie, setCookie } from 'hono/cookie';
import {
beginSignIn,
coinpayConfig,
@@ -127,7 +127,10 @@ export function registerCoinpay(app, overrides = null) {
const { profiles } = await import('../lib/profile.js');
await saveOpenProfileContact(profiles, String(user.id), openprofileUrl);
} catch (err) {
- console.warn('[coinpay] OpenProfile import skipped:', err instanceof Error ? err.message : err);
+ console.warn(
+ '[coinpay] OpenProfile import skipped:',
+ err instanceof Error ? err.message : err,
+ );
}
}
return c.redirect(back('/settings', 'CoinPay connected.', 'notice'), 303);
diff --git a/apps/web/src/views/pages.jsx b/apps/web/src/views/pages.jsx
index 34bdc5b..caaffaa 100644
--- a/apps/web/src/views/pages.jsx
+++ b/apps/web/src/views/pages.jsx
@@ -837,7 +837,13 @@ export const Settings = ({
{user.email}. Also at /api/v1/me/profile.