From c011ed5a2f45379aafd79b0e6fd3a87b64287651 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 25 Aug 2022 08:59:47 -0700 Subject: fix withdrawals --- src/routes/withdraw/+server.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/routes/withdraw/+server.js') diff --git a/src/routes/withdraw/+server.js b/src/routes/withdraw/+server.js index 3f34b023..ed6e74ed 100644 --- a/src/routes/withdraw/+server.js +++ b/src/routes/withdraw/+server.js @@ -1,9 +1,8 @@ -import { post } from '$lib/utils'; +import { auth, post } from '$lib/utils'; -export async function POST({ locals, request }) { - let { token } = locals; +export async function POST({ request }) { let body = await request.json(); - await post('/lightning/send', body, { - authorization: `Bearer ${token}` - }); + await post('/lightning/send', body, auth(request)); + + return new Response(JSON.stringify("ok"), { headers: { 'content-type': 'application/json' } }); } -- cgit v1.2.3