diff options
| author | Adam Soltys <[email protected]> | 2022-08-16 16:26:05 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-16 16:26:05 -0700 |
| commit | 7b9bc9be24a565d513c8904237563479265aee9f (patch) | |
| tree | 4749a3d4dd845e13f23c38924752007a281775c0 /src/routes/login | |
| parent | 4228d55f0be8497b2f8360460d68e99f14cc7d07 (diff) | |
| download | coinos-ui-7b9bc9be24a565d513c8904237563479265aee9f.tar.gz coinos-ui-7b9bc9be24a565d513c8904237563479265aee9f.zip | |
endpoint migrations
Diffstat (limited to 'src/routes/login')
| -rw-r--r-- | src/routes/login/+page.server.js | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/routes/login/+page.server.js b/src/routes/login/+page.server.js index 7b70d944..2dfb962d 100644 --- a/src/routes/login/+page.server.js +++ b/src/routes/login/+page.server.js @@ -3,23 +3,19 @@ import cookie from 'cookie'; let maxAge = 30 * 24 * 60 * 60; -export async function POST({ request }) { +export async function POST({ setHeaders, request }) { let body = await post('/login', await request.json()); let expires = new Date(); expires.setSeconds(expires.getSeconds() + maxAge); - throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292699)"); - return { - body, - headers: { - 'set-cookie': cookie.serialize('token', body.token, { - httpOnly: true, - maxAge, - sameSite: 'lax', - path: '/', - expires - }) - } - }; + setHeaders({ + 'set-cookie': cookie.serialize('token', body.token, { + httpOnly: true, + maxAge, + sameSite: 'lax', + path: '/', + expires + }) + }); } |
