Skip to content

Commit 2cd06cd

Browse files
committed
💥 Fix avatar name & username mixup
1 parent e660c35 commit 2cd06cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎packages/hub/src/lib/oauth-handle-redirect.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export async function oauthHandleRedirect(opts?: { hubUrl?: string }): Promise<O
161161
sub: string;
162162
name: string;
163163
picture: string;
164+
preferred_username: string;
164165
isEnterprise: boolean;
165166
canPay?: boolean;
166167
roleInOrg?: string;
@@ -172,8 +173,8 @@ export async function oauthHandleRedirect(opts?: { hubUrl?: string }): Promise<O
172173
accessTokenExpiresAt,
173174
userInfo: {
174175
id: userInfo.sub,
175-
name: userInfo.name,
176-
fullname: userInfo.preferred_username,
176+
name: userInfo.preferred_username,
177+
fullname: userInfo.name,
177178
email: userInfo.email,
178179
emailVerified: userInfo.email_verified,
179180
avatarUrl: userInfo.picture,
@@ -182,7 +183,7 @@ export async function oauthHandleRedirect(opts?: { hubUrl?: string }): Promise<O
182183
orgs:
183184
userInfo.orgs?.map((org) => ({
184185
id: org.sub,
185-
name: org.name,
186+
name: org.preferred_username,
186187
fullname: org.name,
187188
isEnterprise: org.isEnterprise,
188189
canPay: org.canPay,

0 commit comments

Comments
 (0)