diff --git a/server/oauth.mjs b/server/oauth.mjs index 20a5218..3476b32 100644 --- a/server/oauth.mjs +++ b/server/oauth.mjs @@ -51,7 +51,7 @@ export class CharacterOAuth{ app.get('/mcp/consent',async(req,res)=>{ const p=await this.codec.open(req.query.ticket);if(p?.purpose!=='mcp-consent')return res.status(400).send('Authorization expired. Reconnect your MCP client.'); if(!req.identity){cookie(res,'__Host-character-mcp-return',await this.codec.seal({purpose:'mcp-return',ticket:req.query.ticket},600),600);return res.redirect('/auth/login')} - const client=await this.storage.client(p.clientId);if(!client)return res.sendStatus(400); + const client=await this.clientsStore.getClient(p.clientId);if(!client)return res.sendStatus(400); const nonce=randomUUID();cookie(res,'__Host-character-consent',await this.codec.seal({nonce,sub:req.identity.sub,ticketHash:hash(req.query.ticket)},600),600); res.type('html').send(`Connect Character

Connect ${escape(client.client_name)}?

This client can ${p.params.scopes.includes('characters:write')?'read and edit':'read'} the characters saved to your Arrowstack account and campaigns you belong to, within your campaign roles. Private character notes are never shared with the party. DM secrets require a DM role, and changing another player’s saved HP requires their explicit delegation.

Redirect destination: ${escape(new URL(p.params.redirectUri).origin)}

`); });