From 3cd4782cd2fb8e9adb2b0287653a20e750b6587a Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 28 Sep 2025 11:25:34 -0700 Subject: [PATCH] Refactor: Return username on successful sign-up --- functions/api/signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/api/signup.js b/functions/api/signup.js index 3952218..d70ed36 100644 --- a/functions/api/signup.js +++ b/functions/api/signup.js @@ -6,6 +6,6 @@ export async function onRequestPost({ request, env }) { return new Response('User already exists', { status: 409 }); await env.D1_EV.prepare("INSERT INTO users (username, pass_hash) VALUES (?, ?)") .bind(username, pass_hash).run(); - return Response.json({ success: true }, { status: 201 }); + return Response.json({ success: true, username }, { status: 201 }); } catch (e) { return new Response(e.message, { status: 500 }); } }