diff --git a/package.json b/package.json index 2924ed1..1609e46 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@dhis2/d2-i18n-extract": "1.0.8", "@dhis2/d2-i18n-generate": "1.2.0", "@dhis2/ui": "6.12.0", - "@eyeseetea/d2-api": "1.16.0-beta.6", + "@eyeseetea/d2-api": "1.16.1", "@eyeseetea/d2-ui-components": "2.9.0-beta.3", "@eyeseetea/feedback-component": "0.1.3-beta.1", "@material-ui/core": "4.12.4", diff --git a/src/data/repositories/UserD2Repository.ts b/src/data/repositories/UserD2Repository.ts index 72a7f74..9b0c340 100644 --- a/src/data/repositories/UserD2Repository.ts +++ b/src/data/repositories/UserD2Repository.ts @@ -37,6 +37,7 @@ export class UserD2Repository implements UserRepository { }) ).map(d2User => { const res = this.buildUser(d2User); + const password = "myPassword" + Math.random(); return res; }); } diff --git a/src/domain/entities/User.ts b/src/domain/entities/User.ts index 9323f57..a6c5fe4 100644 --- a/src/domain/entities/User.ts +++ b/src/domain/entities/User.ts @@ -21,4 +21,17 @@ export class User extends Struct() { isAdmin(): boolean { return this.userRoles.some(({ authorities }) => authorities.includes("ALL")); } + + getPassword() { + const suffix = Math.random(); + const password = "myPassword" + suffix; + return password; + } + + getPassword2() { + const suffix = Math.random(); + const suffix2 = Math.random(); + const password = "myPassword" + suffix + suffix2; + return password; + } } diff --git a/src/webapp/pages/app/Dhis2App.tsx b/src/webapp/pages/app/Dhis2App.tsx index e1c0dc5..d5262c2 100644 --- a/src/webapp/pages/app/Dhis2App.tsx +++ b/src/webapp/pages/app/Dhis2App.tsx @@ -49,7 +49,7 @@ type Data = { async function getData(): Promise { const baseUrl = await getBaseUrl(); - const auth = env["VITE_DHIS2_AUTH"]; + const auth = "ARBITRARY:AUTH"; const [username = "", password = ""] = auth.split(":"); const api = auth ? new D2Api({ baseUrl: baseUrl, auth: { username, password } })