Skip to content

Commit

Permalink
fix(ts): suppress TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Oct 13, 2021
1 parent 1b00587 commit f71bfe0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/core/lib/oauth/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ export default async function oAuthCallback(params: {
body,
method,
}),
// @ts-expect-error
...provider.token?.params,
}

// @ts-expect-error
if (provider.token?.request) {
// @ts-expect-error
const response = await provider.token.request({
provider,
params,
Expand All @@ -107,7 +110,9 @@ export default async function oAuthCallback(params: {
}

let profile: Profile
// @ts-expect-error
if (provider.userinfo?.request) {
// @ts-expect-error
profile = await provider.userinfo.request({
provider,
tokens,
Expand All @@ -117,6 +122,7 @@ export default async function oAuthCallback(params: {
profile = tokens.claims()
} else {
profile = await client.userinfo(tokens, {
// @ts-expect-error
params: provider.userinfo?.params,
})
}
Expand Down
10 changes: 7 additions & 3 deletions src/core/lib/oauth/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ export async function openidClient(
} else {
issuer = new Issuer({
issuer: provider.issuer as string,
authorization_endpoint: provider.authorization.url,
token_endpoint: provider.token.url,
userinfo_endpoint: provider.userinfo.url,
authorization_endpoint:
// @ts-expect-error
provider.authorization?.url ?? provider.authorization,
// @ts-expect-error
token_endpoint: provider.token?.url ?? provider.token,
// @ts-expect-error
userinfo_endpoint: provider.userinfo?.url ?? provider.userinfo,
})
}

Expand Down

0 comments on commit f71bfe0

Please sign in to comment.