File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ interface Oauth2Profile {
9
9
photo : string
10
10
}
11
11
12
- export function parseProfile ( data : Record < string , string > ) : Oauth2Profile {
12
+ // eslint-disable-next-line
13
+ type ProfileData = Record < string , any > | string
14
+
15
+ export function parseProfile ( data : ProfileData ) : Oauth2Profile {
13
16
const username = extractProfileAttribute ( data , config . oauth2 . userProfileUsernameAttr ) as string
14
17
const displayName = extractProfileAttribute ( data , config . oauth2 . userProfileDisplayNameAttr ) as string
15
18
const email = extractProfileAttribute ( data , config . oauth2 . userProfileEmailAttr ) as string
@@ -28,7 +31,7 @@ export function parseProfile(data: Record<string, string>): Oauth2Profile {
28
31
}
29
32
}
30
33
31
- export function extractProfileAttribute ( data : any , path : string ) : string | string [ ] | undefined {
34
+ export function extractProfileAttribute ( data : ProfileData , path : string ) : string | string [ ] | undefined {
32
35
if ( ! data ) return undefined
33
36
if ( typeof path !== 'string' ) return undefined
34
37
// can handle stuff like `attrs[0].name`
@@ -44,7 +47,7 @@ export function extractProfileAttribute(data: any, path: string): string | strin
44
47
}
45
48
if ( ! data ) return undefined
46
49
}
47
- return data
50
+ return data as string
48
51
}
49
52
50
53
interface OAuth2CustomStrategyOptions extends StrategyOptions {
You can’t perform that action at this time.
0 commit comments