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 {
99 photo : string
1010}
1111
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 {
1316 const username = extractProfileAttribute ( data , config . oauth2 . userProfileUsernameAttr ) as string
1417 const displayName = extractProfileAttribute ( data , config . oauth2 . userProfileDisplayNameAttr ) as string
1518 const email = extractProfileAttribute ( data , config . oauth2 . userProfileEmailAttr ) as string
@@ -28,7 +31,7 @@ export function parseProfile(data: Record<string, string>): Oauth2Profile {
2831 }
2932}
3033
31- export function extractProfileAttribute ( data : any , path : string ) : string | string [ ] | undefined {
34+ export function extractProfileAttribute ( data : ProfileData , path : string ) : string | string [ ] | undefined {
3235 if ( ! data ) return undefined
3336 if ( typeof path !== 'string' ) return undefined
3437 // can handle stuff like `attrs[0].name`
@@ -44,7 +47,7 @@ export function extractProfileAttribute(data: any, path: string): string | strin
4447 }
4548 if ( ! data ) return undefined
4649 }
47- return data
50+ return data as string
4851}
4952
5053interface OAuth2CustomStrategyOptions extends StrategyOptions {
You can’t perform that action at this time.
0 commit comments