You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Change format of `userInfo` returned, use raw response from the hub
- Make it work in non-browser context (user needs to pass additional
args) - useful for automated tests
- Add automated tests
Due to breaking change, will need major version upgrade
In the end I decided to go with the raw response, without transforming
it.
Because a lot of the fields are standard openID connect fields (eg
`preferred_username`), and to make the developer's job easier when they
search docs or they already have other OpenID integrations in their app.
Even if it's snake_case while the rest of the API is camelCase.
* OpenID Connect field. Unique identifier for the user, even in case of rename.
7
+
*/
8
+
sub: string;
9
+
/**
10
+
* OpenID Connect field. The user's full name.
11
+
*/
12
+
name: string;
13
+
/**
14
+
* OpenID Connect field. The user's username.
15
+
*/
16
+
preferred_username: string;
17
+
/**
18
+
* OpenID Connect field, available if scope "email" was granted.
19
+
*/
20
+
email_verified?: boolean;
21
+
/**
22
+
* OpenID Connect field, available if scope "email" was granted.
23
+
*/
24
+
email?: string;
25
+
/**
26
+
* OpenID Connect field. The user's profile picture URL.
27
+
*/
28
+
picture: string;
29
+
/**
30
+
* OpenID Connect field. The user's profile URL.
31
+
*/
32
+
profile: string;
33
+
/**
34
+
* OpenID Connect field. The user's website URL.
35
+
*/
36
+
website?: string;
37
+
38
+
/**
39
+
* Hugging Face field. Whether the user is a pro user.
40
+
*/
41
+
isPro: boolean;
42
+
/**
43
+
* Hugging Face field. Whether the user has a payment method set up. Needs "read-billing" scope.
44
+
*/
45
+
canPay?: boolean;
46
+
/**
47
+
* Hugging Face field. The user's orgs
48
+
*/
49
+
orgs?: Array<{
50
+
/**
51
+
* OpenID Connect field. Unique identifier for the org.
52
+
*/
53
+
sub: string;
54
+
/**
55
+
* OpenID Connect field. The org's full name.
56
+
*/
57
+
name: string;
58
+
/**
59
+
* OpenID Connect field. The org's username.
60
+
*/
61
+
preferred_username: string;
62
+
/**
63
+
* OpenID Connect field. The org's profile picture URL.
64
+
*/
65
+
picture: string;
66
+
67
+
/**
68
+
* Hugging Face field. Whether the org is an enterprise org.
69
+
*/
70
+
isEnterprise: boolean;
71
+
/**
72
+
* Hugging Face field. Whether the org has a payment method set up. Needs "read-billing" scope, and the user needs to approve access to the org in the OAuth page.
73
+
*/
74
+
canPay?: boolean;
75
+
/**
76
+
* Hugging Face field. The user's role in the org. The user needs to approve access to the org in the OAuth page.
77
+
*/
78
+
roleInOrg?: string;
79
+
/**
80
+
* HuggingFace field. When the user granted the oauth app access to the org, but didn't complete SSO.
81
+
*
82
+
* Should never happen directly after the oauth flow.
83
+
*/
84
+
pendingSSO?: boolean;
85
+
/**
86
+
* HuggingFace field. When the user granted the oauth app access to the org, but didn't complete MFA.
87
+
*
88
+
* Should never happen directly after the oauth flow.
89
+
*/
90
+
missingMFA?: boolean;
91
+
}>;
92
+
}
93
+
4
94
exportinterfaceOAuthResult{
5
95
accessToken: string;
6
96
accessTokenExpiresAt: Date;
7
-
userInfo: {
8
-
id: string;
9
-
name: string;
10
-
fullname: string;
11
-
email?: string;
12
-
emailVerified?: boolean;
13
-
avatarUrl: string;
14
-
websiteUrl?: string;
15
-
isPro: boolean;
16
-
canPay?: boolean;
17
-
orgs: Array<{
18
-
id: string;
19
-
name: string;
20
-
isEnterprise: boolean;
21
-
canPay?: boolean;
22
-
avatarUrl: string;
23
-
roleInOrg?: string;
24
-
}>;
25
-
};
97
+
userInfo: UserInfo;
26
98
/**
27
99
* State passed to the OAuth provider in the original request to the OAuth provider.
0 commit comments