aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/logout
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-16 16:26:05 -0700
committerAdam Soltys <[email protected]>2022-08-16 16:26:05 -0700
commit7b9bc9be24a565d513c8904237563479265aee9f (patch)
tree4749a3d4dd845e13f23c38924752007a281775c0 /src/routes/logout
parent4228d55f0be8497b2f8360460d68e99f14cc7d07 (diff)
downloadcoinos-ui-7b9bc9be24a565d513c8904237563479265aee9f.tar.gz
coinos-ui-7b9bc9be24a565d513c8904237563479265aee9f.zip
endpoint migrations
Diffstat (limited to 'src/routes/logout')
-rw-r--r--src/routes/logout/+page.server.js32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/routes/logout/+page.server.js b/src/routes/logout/+page.server.js
index 2b252aae..40ddcfff 100644
--- a/src/routes/logout/+page.server.js
+++ b/src/routes/logout/+page.server.js
@@ -1,3 +1,4 @@
+import { redirect } from '@sveltejs/kit';
import cookie from 'cookie';
const opts = {
@@ -7,21 +8,18 @@ const opts = {
};
export async function load({ request: { headers } }) {
- throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292699)");
- return {
- status: 302,
- headers: {
- location: '/logout/done',
- 'set-cookie': [
- cookie.serialize('token', '', {
- ...opts,
- expires: new Date(0)
- }),
- cookie.serialize('refresh_token', '', {
- ...opts,
- expires: new Date(0)
- })
- ]
- }
- };
+ setHeaders({
+ 'set-cookie': [
+ cookie.serialize('token', '', {
+ ...opts,
+ expires: new Date(0)
+ }),
+ cookie.serialize('refresh_token', '', {
+ ...opts,
+ expires: new Date(0)
+ })
+ ]
+ });
+
+ throw redirect(302, '/logout/done');
}