这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(oidc): dpop typo #1482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/oidc-client/src/oidcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ export class OidcClient {
return getValidTokenAsync(oidcToken, waitMs, numberWait);
}

fetchWithTokens(fetch: Fetch, demonstrating_proof_of_possession: boolean = false): Fetch {
return fetchWithTokens(fetch, this._oidc, demonstrating_proof_of_possession);
fetchWithTokens(fetch: Fetch, demonstratingProofOfPossession: boolean = false): Fetch {
return fetchWithTokens(fetch, this._oidc, demonstratingProofOfPossession);
}

async userInfoAsync<T extends OidcUserInfo = OidcUserInfo>(
noCache = false,
demonstrating_proof_of_possession: boolean = false,
demonstratingProofOfPossession: boolean = false,
): Promise<T> {
return this._oidc.userInfoAsync(noCache, demonstrating_proof_of_possession);
return this._oidc.userInfoAsync(noCache, demonstratingProofOfPossession);
}

userInfo<T extends OidcUserInfo = OidcUserInfo>(): T {
Expand Down
12 changes: 6 additions & 6 deletions packages/react-oidc/src/FetchToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ const fetchWithToken =
(
fetch: Fetch,
getOidcWithConfigurationName: () => OidcClient | null,
demonstrating_proof_of_possession: boolean = false,
demonstratingProofOfPossession: boolean = false,
) =>
async (...params: Parameters<Fetch>) => {
const oidc = getOidcWithConfigurationName();
const newFetch = oidc.fetchWithTokens(fetch, demonstrating_proof_of_possession);
const newFetch = oidc.fetchWithTokens(fetch, demonstratingProofOfPossession);
return await newFetch(...params);
};

export const withOidcFetch =
(
fetch: Fetch = null,
configurationName = defaultConfigurationName,
demonstrating_proof_of_possession: boolean = false,
demonstratingProofOfPossession: boolean = false,
) =>
WrappedComponent =>
(props: ComponentWithOidcFetchProps) => {
const { fetch: newFetch } = useOidcFetch(
fetch || props.fetch,
configurationName,
demonstrating_proof_of_possession,
demonstratingProofOfPossession,
);
return <WrappedComponent {...props} fetch={newFetch} />;
};

export const useOidcFetch = (
fetch: Fetch = null,
configurationName = defaultConfigurationName,
demonstrating_proof_of_possession: boolean = false,
demonstratingProofOfPossession: boolean = false,
) => {
const previousFetch = fetch || window.fetch;
const getOidc = OidcClient.get;
Expand All @@ -49,7 +49,7 @@ export const useOidcFetch = (
const newFetch = fetchWithToken(
previousFetch,
getOidcWithConfigurationName,
demonstrating_proof_of_possession,
demonstratingProofOfPossession,
);
return newFetch(input, init);
},
Expand Down
Loading