@eo-sdk/client 8.4.1 → 8.6.0
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.
- package/app/eo-framework/settings/change-password/change-password-form/change-password-form.component.d.ts +4 -0
- package/assets/_default/i18n/de.json +3 -0
- package/assets/_default/i18n/en.json +3 -0
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js +19 -6
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js.map +1 -1
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js +2 -2
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js.map +1 -1
- package/bundles/eo-sdk-client.umd.js +10 -4
- package/bundles/eo-sdk-client.umd.js.map +1 -1
- package/bundles/eo-sdk-client.umd.min.js +1 -1
- package/bundles/eo-sdk-client.umd.min.js.map +1 -1
- package/eo-sdk-client.metadata.json +1 -1
- package/esm2015/app/eo-client/about-state/about-state.component.js +3 -3
- package/esm2015/app/eo-framework/settings/change-password/change-password-form/change-password-form.component.js +9 -3
- package/esm2015/projects/eo-sdk/core/lib/model/eo-user.model.js +1 -1
- package/esm2015/projects/eo-sdk/core/lib/service/auth/auth.service.js +2 -2
- package/esm2015/projects/eo-sdk/core/lib/service/user/user.service.js +19 -6
- package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js +19 -6
- package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js.map +1 -1
- package/fesm2015/eo-sdk-client.js +10 -4
- package/fesm2015/eo-sdk-client.js.map +1 -1
- package/package.json +2 -2
- package/projects/eo-sdk/core/eo-sdk-client-projects-eo-sdk-core.metadata.json +1 -1
- package/projects/eo-sdk/core/lib/model/eo-user.model.d.ts +4 -0
- package/projects/eo-sdk/core/lib/service/user/user.service.d.ts +7 -2
- 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
|
|
1667
|
+
* @param res The user to be set as current user
|
|
1668
1668
|
*/
|
|
1669
|
-
setCurrentUser(
|
|
1670
|
-
this.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(
|
|
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(
|
|
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
|