@cloudbase/auth 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -2487,7 +2487,7 @@ class Auth {
2487
2487
  return {
2488
2488
  id: userId,
2489
2489
  aud: 'authenticated',
2490
- role: userInfo.groups.map(group => (typeof group === 'string' ? group : group.id)),
2490
+ role: userInfo.groups?.map?.(group => (typeof group === 'string' ? group : group.id)),
2491
2491
  email: email || '',
2492
2492
  email_confirmed_at: userInfo?.email_verified ? userInfo.created_at : userInfo.created_at,
2493
2493
  phone,
@@ -2507,7 +2507,7 @@ class Auth {
2507
2507
  locale: userInfo?.locale,
2508
2508
  // V2 API 兼容(使用 any 避免类型错误)
2509
2509
  uid: userInfo.uid,
2510
- nickName: userInfo.nickName,
2510
+ nickName: userInfo.nickName || userInfo?.name,
2511
2511
  avatarUrl: userInfo.avatarUrl || userInfo.picture,
2512
2512
  location: userInfo.location,
2513
2513
  hasPassword: userInfo.hasPassword,