fix(rflows): align Openfort wallet label with flow-service

Use `user-${email}` instead of raw `email` as the Openfort player label,
matching the flow-service convention. Openfort rejects colons in labels,
and both codepaths must use the same format so users get the same wallet
regardless of whether they on-ramp via rfunds.online or rspace.online.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-03 01:59:15 +00:00
parent 6364eb8deb
commit 8c349d2003
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ export class OpenfortProvider {
/** /**
* Find an existing wallet by player name, or create a new one. * Find an existing wallet by player name, or create a new one.
* Ensures one wallet per label (e.g. "user:alice@example.com"). * Ensures one wallet per label (e.g. "user-alice@example.com").
*/ */
async findOrCreateWallet(label: string, metadata?: Record<string, string>): Promise<WalletInfo> { async findOrCreateWallet(label: string, metadata?: Record<string, string>): Promise<WalletInfo> {
try { try {

View File

@ -238,7 +238,7 @@ routes.post("/api/flows/user-onramp", async (c) => {
if (!onramp) return c.json({ error: "No on-ramp provider available" }, 503); if (!onramp) return c.json({ error: "No on-ramp provider available" }, 503);
// 1. Find or create Openfort smart wallet for this user (one wallet per email) // 1. Find or create Openfort smart wallet for this user (one wallet per email)
const wallet = await _openfort.findOrCreateWallet(email, { const wallet = await _openfort.findOrCreateWallet(`user-${email}`, {
type: 'user-onramp', type: 'user-onramp',
email, email,
}); });