Răsfoiți Sursa

refs 124384: make email optional for ldap user

Futa Arai 2 ani în urmă
părinte
comite
a7268166fc

+ 1 - 1
apps/app/src/features/external-user-group/interfaces/external-user-group.ts

@@ -35,7 +35,7 @@ export type ExternalUserInfo = {
   id: string, // external user id
   username: string,
   name?: string,
-  email: string,
+  email?: string,
 }
 
 // Data structure to express the tree structure of external groups, before converting to ExternalUserGroup model

+ 1 - 1
apps/app/src/features/external-user-group/server/service/ldap-user-group-sync-service.ts

@@ -120,7 +120,7 @@ class LdapUserGroupSyncService extends ExternalUserGroupSyncService {
         const nameToBeRegistered = this.ldapService.getStringValFromSearchResultEntry(userEntry, attrMapName);
         const mailToBeRegistered = this.ldapService.getStringValFromSearchResultEntry(userEntry, attrMapMail);
 
-        return usernameToBeRegistered != null && mailToBeRegistered != null ? {
+        return usernameToBeRegistered != null ? {
           id: uid,
           username: usernameToBeRegistered,
           name: nameToBeRegistered,

+ 1 - 1
apps/app/src/server/service/external-account.ts

@@ -20,7 +20,7 @@ class ExternalAccountService {
     this.passportService = passportService;
   }
 
-  async getOrCreateUser(userInfo: {id: string, username: string, name?: string, email: string}, providerId: string): Promise<IExternalAccount | undefined> {
+  async getOrCreateUser(userInfo: {id: string, username: string, name?: string, email?: string}, providerId: string): Promise<IExternalAccount | undefined> {
     // get option
     const isSameUsernameTreatedAsIdenticalUser = this.passportService.isSameUsernameTreatedAsIdenticalUser(providerId);
     const isSameEmailTreatedAsIdenticalUser = this.passportService.isSameEmailTreatedAsIdenticalUser(providerId);