Skip to content

Commit

Permalink
Fix reg
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPeck committed Dec 9, 2024
1 parent 2c3f3d4 commit e69c9cf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ const User = types
encryptedCreds: types.maybeNull(types.string),
acceptedTerms: '1900-01-01T01:00:00.000Z',
applyReason: 'N/A',
dataSources: types.optional(types.array(types.string), []),
aaAffiliation: types.maybeNull(types.optional(types.string, '')),
aaProjectId: types.maybeNull(types.optional(types.string, '')),
aaProjectName: types.maybeNull(types.optional(types.string, '')),
piName: types.maybeNull(types.optional(types.string, '')),
projectName: types.maybeNull(types.optional(types.string, '')),
})
.actions(self => ({
runInAction(fn) {
Expand Down Expand Up @@ -78,6 +84,12 @@ const User = types
self.encryptedCreds = rawUser.encryptedCreds || self.encryptedCreds;
self.applyReason = rawUser.applyReason || self.applyReason || '';
self.acceptedTerms = rawUser.acceptedTerms || self.acceptedTerms || '';
self.dataSources = rawUser.dataSources || self.dataSources || [];
self.aaAffiliation = rawUser.aaAffiliation || self.aaAffiliation || '';
self.piName = rawUser.piName || self.piName || '';
self.projectName = rawUser.projectName || self.projectName || '';
self.aaProjectId = rawUser.aaProjectId || self.aaProjectId || '';
self.aaProjectName = rawUser.aaProjectName || self.aaProjectName || '';
// we don't update the other fields because they are being populated by a separate store
},
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,19 @@ class RegisterUserService extends Service {
const authProviders = await authConfigService.getAuthenticationProviderConfigs();
const providerConfig = authProviders[0].config;

const { lastName, firstName, email, acceptedTerms } = user;
const {
lastName,
firstName,
email,
acceptedTerms,
dataSources,
aaAffiliation,
piName,
projectName,
aaProjectId,
aaProjectName,
} = user;

const identityProviderName =
providerConfig.federatedIdentityProviders.length === 0
? providerConfig.title
Expand All @@ -85,6 +97,12 @@ class RegisterUserService extends Service {
encryptedCreds: 'N/A',
firstName,
lastName,
projectName,
dataSources,
aaAffiliation,
piName,
aaProjectId,
aaProjectName,
identityProviderName,
authenticationProviderId,
isAdmin: false,
Expand Down

0 comments on commit e69c9cf

Please sign in to comment.