diff --git a/bun.lock b/bun.lock index cac7701a..71987329 100644 --- a/bun.lock +++ b/bun.lock @@ -8,7 +8,7 @@ "@profullstack/affiliates": "^0.3.0", "@profullstack/coinpay-onboard": "0.4.0", "@profullstack/footer": "latest", - "@profullstack/profile": "0.1.6", + "@profullstack/profile": "0.1.7", "@profullstack/redeem-credits": "^0.2.0", "@profullstack/referrals": "^0.1.0", "@profullstack/stack": "^0.5.0", @@ -305,7 +305,9 @@ "@profullstack/keys": ["@profullstack/keys@0.1.0", "", {}, "sha512-Vys47LvS5ivhdZu4SYOxh9Le3DEmWhjP0+CtrU45RhXAbY0ZFG/2Dk9V1bIIUGDp8UWMJqctvUD21JrNjfh04w=="], - "@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/redeem-credits": ["@profullstack/redeem-credits@0.2.0", "", { "bin": { "redeem-credits": "dist/cli.js" } }, "sha512-JLowb7mWYfouIK7O522tuPPhvLjQjhdEfm6g3xEYrlNLGzLhrIADDhrYldBlGHfiVBWUFX7wefLuCSLF9fnyog=="], diff --git a/package.json b/package.json index 89535351..c7de6df1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@profullstack/affiliates": "^0.3.0", "@profullstack/coinpay-onboard": "0.4.0", "@profullstack/footer": "latest", - "@profullstack/profile": "0.1.6", + "@profullstack/profile": "0.1.7", "@profullstack/redeem-credits": "^0.2.0", "@profullstack/referrals": "^0.1.0", "@profullstack/stack": "^0.5.0", diff --git a/src/app/api/coinpay/callback/route.ts b/src/app/api/coinpay/callback/route.ts index d822acfd..1484a0fe 100644 --- a/src/app/api/coinpay/callback/route.ts +++ b/src/app/api/coinpay/callback/route.ts @@ -1,5 +1,7 @@ import { NextResponse, type NextRequest } from "next/server"; import { finishSignIn } from "@profullstack/coinpay-onboard/oauth"; +import { saveOpenProfileContact } from "@profullstack/profile"; +import { profileStore } from "@/lib/profile"; import { createServerSupabaseClient, createServiceClient } from "@/lib/supabase/server"; import { getSiteUrl } from "@/lib/site-url"; import { @@ -91,6 +93,10 @@ export async function GET(request: NextRequest) { claims, }, store); if (!resolved.ok) return fail(resolved.code); + if (pending.mode === "connect" && groupcallAction !== "disconnect" && typeof result.userinfo.openprofile_url === "string") { + try { await saveOpenProfileContact(profileStore(), resolved.userId, result.userinfo.openprofile_url); } + catch { console.warn("[coinpay] OpenProfile import skipped"); } + } if (pending.mode === "connect" && !groupcallAction) return to("/settings?coinpay=connected"); if (groupcallAction) { diff --git a/src/components/profile-card.tsx b/src/components/profile-card.tsx index 4626bb65..f0734807 100644 --- a/src/components/profile-card.tsx +++ b/src/components/profile-card.tsx @@ -50,7 +50,7 @@ export function ProfileCard() {

Profile

- +