From d3f8918d8923bccc3e49267329816ca8a9499deb Mon Sep 17 00:00:00 2001 From: Eric Lim Date: Mon, 2 Sep 2024 17:59:39 +0200 Subject: [PATCH] =?UTF-8?q?[TECH]=20Corriger=20les=20seeds=20Acces=20d'?= =?UTF-8?q?=C3=A9l=C3=A8ves=20(PIX-14101)=20(#10017)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Emmanuelle Bonnemay --- .../build-sco-organization-learners.js | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/api/db/seeds/data/team-acces/build-sco-organization-learners.js b/api/db/seeds/data/team-acces/build-sco-organization-learners.js index 2397b1ec164..ebf8554323c 100644 --- a/api/db/seeds/data/team-acces/build-sco-organization-learners.js +++ b/api/db/seeds/data/team-acces/build-sco-organization-learners.js @@ -1,5 +1,4 @@ import { NON_OIDC_IDENTITY_PROVIDERS } from '../../../../src/identity-access-management/domain/constants/identity-providers.js'; -import { DEFAULT_PASSWORD } from '../../../constants.js'; import { SCO_ORGANIZATION_ID } from './constants.js'; export function buildScoOrganizationLearners(databaseBuilder) { @@ -14,7 +13,7 @@ export function buildScoOrganizationLearners(databaseBuilder) { } function _buildScoOrganizationLearnerWithAllConnectionTypes(databaseBuilder) { - const user = databaseBuilder.factory.buildUser({ + const user = databaseBuilder.factory.buildUser.withRawPassword({ firstName: 'Eliza', lastName: 'Delajungle', email: 'eliza-dlj@school.net', @@ -42,7 +41,7 @@ function _buildScoOrganizationLearnerWithAllConnectionTypes(databaseBuilder) { } function _buildScoOrganizationLearnerWithUsernameAndMediacentre(databaseBuilder) { - const user = databaseBuilder.factory.buildUser({ + const user = databaseBuilder.factory.buildUser.withRawPassword({ firstName: 'Bob', lastName: 'Leponge', email: null, @@ -70,14 +69,14 @@ function _buildScoOrganizationLearnerWithUsernameAndMediacentre(databaseBuilder) } function _buildScoOrganizationLearnerWithUsernameAndEmail(databaseBuilder) { - const user = databaseBuilder.factory.buildUser({ + const user = databaseBuilder.factory.buildUser.withRawPassword({ firstName: 'Naruto', lastName: 'Uzumaki', email: 'hokage@school.net', username: 'naruto.uzumaki.0303', }); - const organizationLearner = databaseBuilder.factory.buildOrganizationLearner({ + databaseBuilder.factory.buildOrganizationLearner({ firstName: user.firstName, lastName: user.lastName, birthdate: '2013-03-03', @@ -87,18 +86,10 @@ function _buildScoOrganizationLearnerWithUsernameAndEmail(databaseBuilder) { userId: user.id, nationalStudentId: '123456789NU', }); - - databaseBuilder.factory.buildAuthenticationMethod.withPixAsIdentityProviderAndPassword({ - userFirstName: organizationLearner.firstName, - userLastName: organizationLearner.lastName, - password: DEFAULT_PASSWORD, - shouldChangePassword: false, - userId: user.id, - }); } function _buildScoOrganizationLearnerWithEmailAndMediacentre(databaseBuilder) { - const userWithoutPixAuthenticationMethod = databaseBuilder.factory.buildUser({ + const userWithoutPixAuthenticationMethod = databaseBuilder.factory.buildUser.withRawPassword({ firstName: 'Bart', lastName: 'Simpson', email: 'bart@school.net', @@ -144,7 +135,7 @@ function _buildScoOrganizationLearnerWithEmailAndMediacentre(databaseBuilder) { } function _buildScoOrganizationLearnerWithEmail(databaseBuilder) { - const user = databaseBuilder.factory.buildUser({ + const user = databaseBuilder.factory.buildUser.withRawPassword({ firstName: 'Hermione', lastName: 'Granger', email: 'hermione@school.net', @@ -164,7 +155,7 @@ function _buildScoOrganizationLearnerWithEmail(databaseBuilder) { } function _buildScoOrganizationLearnerWithUsername(databaseBuilder) { - const user = databaseBuilder.factory.buildUser({ + const user = databaseBuilder.factory.buildUser.withRawPassword({ firstName: 'Kirua', lastName: 'Zoldik', email: null,