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
(cherry picked from commit 499e89ac44)
mr13.0
Debora Crescenzo 6 months ago committed by Crescenzo Debora
parent 0e31eec3aa
commit a87fb1b727

@ -129,7 +129,10 @@ export default {
'passwordRequirements' 'passwordRequirements'
]), ]),
areValidationsActive () { 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 () { passwordScoreMappedValue () {
if (this.passwordScore === null || this.passwordScore === undefined) { if (this.passwordScore === null || this.passwordScore === undefined) {

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

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

Loading…
Cancel
Save