Skip to content

Commit 17a13c8

Browse files
authored
Merge pull request #25 from bote795/main
Feat: add the refresh token to user info method
2 parents e0a6b6e + 1e23523 commit 17a13c8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function oAuthPluginServer(
161161
let users: PaginatedDocs<User>
162162
try {
163163
// Get the userinfo
164-
info = await options.userinfo?.(accessToken)
164+
info = await options.userinfo?.(accessToken, refreshToken)
165165
if (!info) throw new Error('Failed to get userinfo')
166166

167167
// Match existing user

src/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export interface oAuthPluginOptions extends StrategyOptions {
3232
authorizePath?: string
3333

3434
/** Map an authentication result to a user */
35-
userinfo: (accessToken: string) => Promise<{
35+
userinfo: (
36+
accessToken: string,
37+
refreshToken?: string
38+
) => Promise<{
3639
/** Unique identifier for the linked account */
3740
sub: string
3841
/** Unique identifier for the linked account */

0 commit comments

Comments
 (0)