Skip to content

Commit 4ba4f06

Browse files
teresaromeroTeresa
and
Teresa
authored
🤖 Merge PR DefinitelyTyped#52168 [@types/passport-spotify] fix verifyFunction arguments order, expires_in is not optional by @teresaromero
Co-authored-by: Teresa <[email protected]>
1 parent 440f282 commit 4ba4f06

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎types/passport-spotify/index.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for passport-spotify 1.1
1+
// Type definitions for passport-spotify 2.0
22
// Project: https://github.com/jmperez/passport-spotify#readme
33
// Definitions by: Rishi Kodali <https://github.com/rishikodali>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -46,18 +46,18 @@ export type VerifyCallback = (error?: Error | null, user?: object, info?: object
4646
export type VerifyFunction = (
4747
accessToken: string,
4848
refreshToken: string,
49+
expires_in: number,
4950
profile: Profile,
50-
done: VerifyCallback,
51-
expires_in?: number,
51+
done: VerifyCallback
5252
) => void;
5353

5454
export type VerifyFunctionWithRequest = (
5555
req: Request,
5656
accessToken: string,
5757
refreshToken: string,
58+
expires_in: number,
5859
profile: Profile,
59-
done: VerifyCallback,
60-
expires_in?: number,
60+
done: VerifyCallback
6161
) => void;
6262

6363
export class Strategy {

‎types/passport-spotify/passport-spotify-tests.ts

+4
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ const strategyOptions: StrategyOptions = {
1818
const verifyFunction: VerifyFunction = (
1919
accessToken: string,
2020
refreshToken: string,
21+
expires_in: number,
2122
profile: Profile,
2223
done: VerifyCallback,
2324
) => {
2425
const user = {
2526
profile,
2627
accessToken,
2728
refreshToken,
29+
expires_in
2830
};
2931

3032
done(null, user);
@@ -43,13 +45,15 @@ const verifyFunctionWithRequest: VerifyFunctionWithRequest = (
4345
req: Request,
4446
accessToken: string,
4547
refreshToken: string,
48+
expires_in: number,
4649
profile: Profile,
4750
done: VerifyCallback,
4851
) => {
4952
const user = {
5053
profile,
5154
accessToken,
5255
refreshToken,
56+
expires_in
5357
};
5458

5559
done(null, user);

0 commit comments

Comments
 (0)