Skip to content

Commit

Permalink
limit discoveries
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherJMiller committed May 28, 2024
1 parent 8e55e76 commit baec3b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/util/oidc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as oidc from 'oauth4webapi';
import Cookies from 'js-cookie';
import { useMemo } from 'react';

interface OpenIdConnectProvider {
issuer: string;
Expand Down Expand Up @@ -48,14 +49,14 @@ export const useOIDCProvider = ({
scopes,
redirectUriPath,
}: OpenIdConnectProvider): OpenIdConnectContext => {
const authorizationServer = oidc
const authorizationServer = useMemo(() => oidc
.discoveryRequest(new URL(issuer))
.then((response) =>
oidc.processDiscoveryResponse(
new URL(expectedIssuer ?? issuer),
response,
),
);
), []);

return {
beginFlow: async () =>
Expand Down

0 comments on commit baec3b4

Please sign in to comment.