@eo-sdk/client 8.5.0-rc.1 → 8.6.0-rc.1

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.
Files changed (26) hide show
  1. package/app/eo-framework/settings/change-password/change-password-form/change-password-form.component.d.ts +4 -0
  2. package/assets/_default/i18n/de.json +3 -0
  3. package/assets/_default/i18n/en.json +4 -1
  4. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js +19 -6
  5. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js.map +1 -1
  6. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js +2 -2
  7. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js.map +1 -1
  8. package/bundles/eo-sdk-client.umd.js +10 -4
  9. package/bundles/eo-sdk-client.umd.js.map +1 -1
  10. package/bundles/eo-sdk-client.umd.min.js +1 -1
  11. package/bundles/eo-sdk-client.umd.min.js.map +1 -1
  12. package/eo-sdk-client.metadata.json +1 -1
  13. package/esm2015/app/eo-client/about-state/about-state.component.js +3 -3
  14. package/esm2015/app/eo-framework/settings/change-password/change-password-form/change-password-form.component.js +9 -3
  15. package/esm2015/projects/eo-sdk/core/lib/model/eo-user.model.js +1 -1
  16. package/esm2015/projects/eo-sdk/core/lib/service/auth/auth.service.js +2 -2
  17. package/esm2015/projects/eo-sdk/core/lib/service/user/user.service.js +19 -6
  18. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js +19 -6
  19. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js.map +1 -1
  20. package/fesm2015/eo-sdk-client.js +10 -4
  21. package/fesm2015/eo-sdk-client.js.map +1 -1
  22. package/package.json +2 -2
  23. package/projects/eo-sdk/core/eo-sdk-client-projects-eo-sdk-core.metadata.json +1 -1
  24. package/projects/eo-sdk/core/lib/model/eo-user.model.d.ts +4 -0
  25. package/projects/eo-sdk/core/lib/service/user/user.service.d.ts +7 -2
  26. package/projects/eo-sdk/core/package.json +1 -1
@@ -1664,14 +1664,15 @@ class UserService {
1664
1664
  }
1665
1665
  /**
1666
1666
  * Set a new current user
1667
- * @param user The user to be set as current user
1667
+ * @param res The user to be set as current user
1668
1668
  */
1669
- setCurrentUser(user) {
1670
- this.user = user;
1669
+ setCurrentUser(res) {
1670
+ this.user = new EoUser(res);
1671
+ this.passwordValidationSettings = res.passwortvalidation;
1671
1672
  this.user.setImageBase(this.backend.getServiceBase());
1672
1673
  this.backend.setHeader('Accept-Language', this.user.getSchemaLocale());
1673
1674
  const languages = this.config.getClientLocales().map(lang => lang.iso);
1674
- let userLang = user.getClientLocale();
1675
+ let userLang = this.user.getClientLocale();
1675
1676
  if (languages.indexOf(userLang) === -1) {
1676
1677
  userLang = this.config.getDefaultClientLocale();
1677
1678
  }
@@ -1830,7 +1831,19 @@ class UserService {
1830
1831
  * Fetches the settings for the current user and stores the new User object on the session
1831
1832
  */
1832
1833
  refreshCurrentUser() {
1833
- return this.backend.get(this.USER_FETCH_URI).pipe(map(res => this.setCurrentUser(new EoUser(res))));
1834
+ return this.backend.get(this.USER_FETCH_URI).pipe(map(res => this.setCurrentUser(res)));
1835
+ }
1836
+ validatePassword(password) {
1837
+ if (password.length < this.passwordValidationSettings.minlength) {
1838
+ return { type: 'short', amount: this.passwordValidationSettings.minlength };
1839
+ }
1840
+ if (password.replace(/[^0-9]/g, '').length < this.passwordValidationSettings.minnumber) {
1841
+ return { type: 'number', amount: this.passwordValidationSettings.minnumber };
1842
+ }
1843
+ if (password.replace(/[a-zA-Z0-9ß ]/g, '').length < this.passwordValidationSettings.minspecialchars) {
1844
+ return { type: 'specialchars', amount: this.passwordValidationSettings.minspecialchars };
1845
+ }
1846
+ return { type: 'valid', amount: null };
1834
1847
  }
1835
1848
  }
1836
1849
  UserService.decorators = [
@@ -3359,7 +3372,7 @@ class AuthService {
3359
3372
  initApp(user, sso) {
3360
3373
  const currUser = new EoUser(user);
3361
3374
  this.backend.setAuthProfile(this.profile);
3362
- this.userService.setCurrentUser(currUser);
3375
+ this.userService.setCurrentUser(user);
3363
3376
  const capabilities = this.capabilitiesService.setCapabilities(user.capabilities, sso);
3364
3377
  this.systemStatusService.init(this.config.getRaw('systemStatusUpdateInterval'));
3365
3378
  // update states