Remove prompt from session data on deny
This commit is contained in:
parent
c4d3c4d003
commit
577e144d0b
1 changed files with 3 additions and 1 deletions
|
@ -45,8 +45,10 @@ export default async function registerWebsiteApi(server: MyFastifyInstance): Pro
|
|||
server.log.error(error);
|
||||
throw server.httpErrors.internalServerError();
|
||||
}
|
||||
const prompt = getSessionData(request.session).prompts.get(request.query.prompt_id);
|
||||
const sessionData = getSessionData(request.session);
|
||||
const prompt = sessionData.prompts.get(request.query.prompt_id);
|
||||
if (!prompt) throw server.httpErrors.badRequest('Prompt data not found');
|
||||
await reply.redirect(`${prompt.redirectUri}?error=access_denied&error_description=${encodeURIComponent('User denied')}`);
|
||||
sessionData.prompts.delete(request.query.prompt_id);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue