diff options
| author | secondl1ght <[email protected]> | 2022-07-30 13:01:35 -0600 |
|---|---|---|
| committer | secondl1ght <[email protected]> | 2022-07-30 13:01:35 -0600 |
| commit | 55719a6d91fad32dc1a633bbbfb5ad9a726ced50 (patch) | |
| tree | c235a822c8b570e6460e5d3b6773b5f025e24531 /src/routes/logout/index.js | |
| parent | 926b1cd61d5bca6e6e9fd3420681d0829341a1e0 (diff) | |
| parent | 7168cd2ea39aaa2158412bb5e966e144e8a22733 (diff) | |
| download | coinos-ui-55719a6d91fad32dc1a633bbbfb5ad9a726ced50.tar.gz coinos-ui-55719a6d91fad32dc1a633bbbfb5ad9a726ced50.zip | |
Merge branch 'master' of github.com:coinos/coinos-ui-v2
Diffstat (limited to 'src/routes/logout/index.js')
| -rw-r--r-- | src/routes/logout/index.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/routes/logout/index.js b/src/routes/logout/index.js new file mode 100644 index 00000000..80e65f8b --- /dev/null +++ b/src/routes/logout/index.js @@ -0,0 +1,26 @@ +import cookie from "cookie"; + +const opts = { + httpOnly: true, + sameSite: "lax", + path: "/", +}; + +export async function GET({ request: { headers } }) { + 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), + }), + ], + }, + }; +} |
