feat(http): prompt=none (closes #507)

This commit is contained in:
Isaac 2024-01-21 02:37:56 +00:00
parent 1b0b0a22f9
commit 5e5de6b4d9
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -25,13 +25,7 @@ module.exports = async client => {
fastify.states = new Map(); fastify.states = new Map();
fastify.register(oauth, { fastify.register(oauth, {
callbackUri: `${process.env.HTTP_EXTERNAL}/auth/callback`, callbackUri: `${process.env.HTTP_EXTERNAL}/auth/callback`,
// checkStateFunction: (req, callback) => { callbackUriParams: { prompt: 'none' },
// if (req.query.state === req.cookies['oauth2-redirect-state']) {
// callback();
// return;
// }
// callback(new Error('Invalid state'));
// },
checkStateFunction: async req => { checkStateFunction: async req => {
if (req.query.state !== req.cookies['oauth2-redirect-state']) { if (req.query.state !== req.cookies['oauth2-redirect-state']) {
throw new Error('Invalid state'); throw new Error('Invalid state');