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/pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions apps/pwa/src/routes/coinpay.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion apps/pwa/src/routes/pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@ pagesRouter.get("/settings", requireAuth, async (req, res) => {
<div class="card" style="margin-bottom:20px"><div class="card-head"><span class="h">Your details</span></div>
<div class="card-body">
<form method="post" action="/settings/profile">${csrfInput(req)}
${renderProfileFields({ values: profileValues, required: ["first_name", "last_name"], idPrefix: "account-" })}
${renderProfileFields({ values: profileValues, required: ["first_name", "last_name"], idPrefix: "account-", importOpenProfile: true })}
<button class="btn">Save details</button>
</form>
</div></div>
<script src="/vendor/profile-enhance.js" defer></script>
<div class="card"><div class="card-head"><span class="h">API keys</span></div>
<div class="card-body">
<p class="dim" style="font-size:.85rem;margin-top:0">A <b>person</b> key acts as you; <code>logicsrc login</code> makes one for you. A <b>machine</b> 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 <code>logicsrc teams grant &lt;team&gt; &lt;project&gt; &lt;env&gt; --key &lt;name&gt;</code>.</p>
Expand Down
6 changes: 4 additions & 2 deletions bun.lock

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

Loading