mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 01:35:17 +01:00
28 lines
553 B
JavaScript
28 lines
553 B
JavaScript
import React from 'react';
|
|
import { serialize } from 'cookie';
|
|
import Layout from 'components/Layout';
|
|
|
|
export default function LogoutPage() {
|
|
return (
|
|
<Layout title="Logout">
|
|
<h2>You've successfully logged out..</h2>
|
|
</Layout>
|
|
);
|
|
}
|
|
|
|
export async function getServerSideProps({ res }) {
|
|
const cookie = serialize('umami.auth', '', {
|
|
path: '/',
|
|
httpOnly: true,
|
|
maxAge: 0,
|
|
});
|
|
|
|
res.statusCode = 303;
|
|
res.setHeader('Set-Cookie', [cookie]);
|
|
res.setHeader('Location', '/login');
|
|
|
|
res.end();
|
|
|
|
return { props: {} };
|
|
}
|