aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/withdraw/+server.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-25 08:59:47 -0700
committerAdam Soltys <[email protected]>2022-08-25 08:59:49 -0700
commitc011ed5a2f45379aafd79b0e6fd3a87b64287651 (patch)
treee875e84879e54109ec4c687f576fd2d74763c0fc /src/routes/withdraw/+server.js
parent42e8425d9066e014ef8236a58b68780f763c59cf (diff)
downloadcoinos-ui-c011ed5a2f45379aafd79b0e6fd3a87b64287651.tar.gz
coinos-ui-c011ed5a2f45379aafd79b0e6fd3a87b64287651.zip
fix withdrawals
Diffstat (limited to 'src/routes/withdraw/+server.js')
-rw-r--r--src/routes/withdraw/+server.js11
1 files changed, 5 insertions, 6 deletions
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' } });
}