Skip to content
Discussion options

You must be logged in to vote

I can't see a flaw

import * as client from "openid-client";

const issuer = new URL("https://op.panva.cz");

{
  let i = 0;
  const customFetch = (url, options) => {
    i++;
    console.debug(`Running custom fetch -> Url: ${url}`);
    return fetch(url, options);
  };

  const config = await client.discovery(issuer, "foo", undefined, undefined, {
    [client.customFetch]: customFetch,
  });

  await client
    .authorizationCodeGrant(
      config,
      new URL("https://rp.example.com/cb?code=foo&iss=https://op.panva.cz")
    )
    .catch(() => {
      /* no op */
    });

  console.log(i);
}

{
  let i = 0;
  const customFetch = (url, options) => {
    i++;
    console.debug(`Running c…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Orange-Rabbit
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants