Skip to content

Commit

Permalink
🤖 Merge PR #69451 [@types/passport-oauth2] Allow login rejects and un…
Browse files Browse the repository at this point in the history
…known errors by @chdanielmueller
  • Loading branch information
chdanielmueller committed May 8, 2024
1 parent 8eae672 commit 7e25529
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/passport-oauth2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare namespace OAuth2Strategy {
verify(req: Request, state: string, meta: Metadata, callback: StateStoreVerifyCallback): void;
}

type VerifyCallback = (err?: Error | null, user?: Express.User, info?: object) => void;
type VerifyCallback = (err?: Error | null | unknown, user?: Express.User | false, info?: object) => void;

type VerifyFunction<TProfile = any, TResults = any> =
| ((accessToken: string, refreshToken: string, profile: TProfile, verified: VerifyCallback) => void)
Expand Down
3 changes: 3 additions & 0 deletions types/passport-oauth2/passport-oauth2-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ const providerSpecificVerifyFunction: OAuth2Strategy.VerifyFunction<
> = (accessToken, refreshToken, results, profile, verified) => {
results.someProviderResultField;
profile.someProviderProfileField;
verified(null, false);
};
const providerSpecificVerifyFunctionWithRequest: OAuth2Strategy.VerifyFunctionWithRequest<
ProviderSpecificProfile,
ProviderSpecificResults
> = (req, accessToken, refreshToken, results, profile, verified) => {
let err: unknown;
results.someProviderResultField;
profile.someProviderProfileField;
verified(err);
};

0 comments on commit 7e25529

Please sign in to comment.