diff options
| author | Adam Soltys <[email protected]> | 2022-11-09 10:53:41 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-09 10:53:41 -0800 |
| commit | 305f26ccefffe52b3fb65995e8caf437f1a92057 (patch) | |
| tree | 0fd1e422bd8195caccb2837a20d1bd97b94dfa82 /src/routes/(app)/disable2fa/+server.js | |
| parent | ccc13974d22a47995b5f9f674891a39d54aa0620 (diff) | |
| download | coinos-ui-305f26ccefffe52b3fb65995e8caf437f1a92057.tar.gz coinos-ui-305f26ccefffe52b3fb65995e8caf437f1a92057.zip | |
settings fixes
Diffstat (limited to 'src/routes/(app)/disable2fa/+server.js')
| -rw-r--r-- | src/routes/(app)/disable2fa/+server.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/routes/(app)/disable2fa/+server.js b/src/routes/(app)/disable2fa/+server.js index 237da445..13fcb2b9 100644 --- a/src/routes/(app)/disable2fa/+server.js +++ b/src/routes/(app)/disable2fa/+server.js @@ -1,8 +1,13 @@ +import { error } from '@sveltejs/kit'; import { auth, post } from '$lib/utils'; -export async function PUT({ cookies, request }) { - let body = await request.json(); - let res = await post('/disable2fa', body, auth(cookies)); +export async function POST({ cookies, request }) { + try { + let body = await request.json(); + let res = await post('/disable2fa', body, auth(cookies)); - return new Response(JSON.stringify(res)); + return new Response(JSON.stringify(res)); + } catch (e) { + throw error(500, 'Problem disabling 2fa'); + } } |
