mirror of
https://github.com/logto-io/logto.git
synced 2025-03-24 22:41:28 -05:00
fix(connector-github): convert null
value to undefined
in user info response (#944)
This commit is contained in:
parent
48607219f5
commit
c325cf60f9
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ import {
|
|||
SocialConnector,
|
||||
GetConnectorConfig,
|
||||
} from '@logto/connector-types';
|
||||
import { assert } from '@silverhand/essentials';
|
||||
import { assert, conditional } from '@silverhand/essentials';
|
||||
import got, { RequestError as GotRequestError } from 'got';
|
||||
|
||||
import {
|
||||
|
@ -90,9 +90,9 @@ export default class GithubConnector implements SocialConnector {
|
|||
|
||||
return {
|
||||
id: String(id),
|
||||
avatar,
|
||||
email,
|
||||
name,
|
||||
avatar: conditional(avatar),
|
||||
email: conditional(email),
|
||||
name: conditional(name),
|
||||
};
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof GotRequestError && error.response?.statusCode === 401) {
|
||||
|
|
Loading…
Add table
Reference in a new issue