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:
parent
6364eb8deb
commit
8c349d2003
|
|
@ -33,7 +33,7 @@ export class OpenfortProvider {
|
|||
|
||||
/**
|
||||
* 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> {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ routes.post("/api/flows/user-onramp", async (c) => {
|
|||
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)
|
||||
const wallet = await _openfort.findOrCreateWallet(email, {
|
||||
const wallet = await _openfort.findOrCreateWallet(`user-${email}`, {
|
||||
type: 'user-onramp',
|
||||
email,
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue