Misklient
+ `);
+ });
+ await fastify.listen({ port: clientPort });
+
+ const client = getClient();
+
+ const response = await fetch(client.authorizeURL({
+ redirect_uri,
+ scope: 'write:notes',
+ state: 'state',
+ code_challenge: 'code',
+ code_challenge_method: 'S256',
+ }));
+ assert.strictEqual(response.status, 200);
+ });
+
+ test('No item', async () => {
+ await fastify.close();
+
+ fastify = Fastify();
+ fastify.get('/', async (request, reply) => {
+ reply.send(`
+
+
Misklient
+ `);
+ });
+ await fastify.listen({ port: clientPort });
+
+ const client = getClient();
+
+ const response = await fetch(client.authorizeURL({
+ redirect_uri,
+ scope: 'write:notes',
+ state: 'state',
+ code_challenge: 'code',
+ code_challenge_method: 'S256',
+ }));
+ // TODO: status code
+ assert.strictEqual(response.status, 500);
+ });
+ });
+
// TODO: authorizing two users concurrently
// TODO: Error format required by OAuth spec