const { Communication: IndieAuthCommunication } = require('@squeep/indieauth-helper');
const { MysteryBox } = require('@squeep/mystery-box');
+const { randomUUID } = require('crypto');
const common = require('./common');
const Enum = require('./enum');
const Template = require('./template');
if (authorizationEndpoint) {
const pkce = await IndieAuthCommunication.generatePKCE();
+ const state = randomUUID();
session = {
authorizationEndpoint: authorizationEndpoint.href,
- state: ctx.requestId,
+ state,
codeVerifier: pkce.codeVerifier,
me,
redirect,