Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 16 additions & 1 deletion apps/web/src/routes/coinpay.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { saveOpenProfileContact } from '@profullstack/profile';
import { getCookie, setCookie } from 'hono/cookie';
import {
beginSignIn,
Expand Down Expand Up @@ -119,7 +120,21 @@ 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.'
Expand Down
9 changes: 8 additions & 1 deletion apps/web/src/views/pages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,18 @@ export const Settings = ({
<code>{user.email}</code>. Also at <code>/api/v1/me/profile</code>.
</p>
<form method="post" action="/api/settings/contact" class="stack">
{raw(renderProfileFields({ fields: PROFILE_FIELDS, values: contact ?? {} }))}
{raw(
renderProfileFields({
fields: PROFILE_FIELDS,
values: contact ?? {},
importOpenProfile: true,
}),
)}
<button type="submit" class="ghost">
Save contact details
</button>
</form>
<script src="/vendor-profile.js" defer />
</section>

{coinpayEnabled() ? (
Expand Down
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading