MT#61536 Improve how password requirements are handled

To make sure compatibility with previous versions
and avoid the app crashing, we are adding
a better handling of the case where security.password
object doesn't exist in platforminfo. This covers
the edge case where costumers with ad hoc solutions
cannot upgrade to latest templates version.

Change-Id: I8aef12170d2f3782424f8b12dc032b3d465fb6b6
mr13.1
Debora Crescenzo 5 months ago committed by Crescenzo Debora
parent 24cda522b6
commit 499e89ac44

@ -129,7 +129,10 @@ export default {
'passwordRequirements'
]),
areValidationsActive () {
return this.passwordType === 'web' ? this.passwordRequirements.web_validate : this.passwordRequirements.sip_validate
const webValidate = this.passwordRequirements?.web_validate || false
const sipValidate = this.passwordRequirements?.sip_validate || false
return this.passwordType === 'web' ? webValidate : sipValidate
},
passwordScoreMappedValue () {
if (this.passwordScore === null || this.passwordScore === undefined) {

@ -87,8 +87,7 @@ export default {
},
computed: {
...mapGetters('user', [
'getSubscriber',
'passwordRequirements'
'getSubscriber'
]),
...mapWaitingGetters({
processingChangeSIPPassword: WAIT_CHANGE_SIP_PASSWORD,

@ -141,7 +141,7 @@ export default {
return state.loginError
},
passwordRequirements (state) {
return state.platformInfo.security.password
return state.platformInfo?.security?.password || []
},
userDataRequesting (state) {
return state.userDataRequesting

Loading…
Cancel
Save