feat(api): redirect on logout

This commit is contained in:
Isaac 2024-07-03 01:39:08 +01:00
parent 8818bf6d48
commit 4d42269a35
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -20,7 +20,15 @@ module.exports.get = fastify => ({
path: '/', path: '/',
sameSite: 'Strict', sameSite: 'Strict',
secure: false, secure: false,
}).send('The token has been revoked.'); });
res.header('Content-Type', 'text/html');
return res.send(`
<!DOCTYPE html>
<html>
<head><meta http-equiv="refresh" content="0; url='/'"></head>
<body></body>
</html>
`);
}, },
onRequest: [fastify.authenticate], onRequest: [fastify.authenticate],
}); });