Fixed test for back-channel logout

This commit is contained in:
Anton SHEPILOV
2024-05-24 20:31:51 +02:00
committed by Anton Shepilov
parent b4412d3ed3
commit 8214a5f6d4
3 changed files with 21 additions and 7 deletions
@@ -20,8 +20,10 @@ const jwtPlugin: FastifyPluginCallback = async (fastify, _opts, next) => {
const authenticate = async (request: FastifyRequest) => {
const jwt: JwtType = await request.jwtVerify();
// Verify the SID exists and is valid
await gr.services.console.getClient().verifyJwtSid(jwt.sid);
// Verify the SID exists and is valid except tokens for the public link
if (!jwt.public_token_document_id) {
await gr.services.console.getClient().verifyJwtSid(jwt.sid);
}
if (jwt.type === "refresh") {
// TODO in the future we must invalidate the refresh token (because it should be single use)