Implement toaster for wrong invite code and wrong nonce

This commit is contained in:
Wolfgang Huß 2021-03-24 14:54:16 +01:00 committed by Ulf Gebhardt
parent 4907eab095
commit 4ddc6fb07a
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
4 changed files with 42 additions and 22 deletions

View File

@ -114,13 +114,20 @@ export default {
}, },
}) })
if ( if (this.sliderData.sliders[this.sliderIndex].data.response) {
this.sliderData.sliders[this.sliderIndex].data.response && if (this.sliderData.sliders[this.sliderIndex].data.response.isValidInviteCode) {
this.sliderData.sliders[this.sliderIndex].data.response.isValidInviteCode
) {
this.$toast.success( this.$toast.success(
this.$t('components.registration.invite-code.form.success', { inviteCode }), this.$t('components.registration.invite-code.form.validations.success', {
inviteCode,
}),
) )
} else {
this.$toast.error(
this.$t('components.registration.invite-code.form.validations.error', {
inviteCode,
}),
)
}
} }
} catch (err) { } catch (err) {
this.sliderData.setSliderValuesCallback(false, { this.sliderData.setSliderValuesCallback(false, {

View File

@ -123,13 +123,22 @@ export default {
sliderData: { request: { variables }, response: response.data }, sliderData: { request: { variables }, response: response.data },
}) })
if ( if (this.sliderData.sliders[this.sliderIndex].data.response) {
this.sliderData.sliders[this.sliderIndex].data.response && if (this.sliderData.sliders[this.sliderIndex].data.response.VerifyNonce) {
this.sliderData.sliders[this.sliderIndex].data.response.VerifyNonce
) {
this.$toast.success( this.$toast.success(
this.$t('components.registration.email-nonce.form.success', { email, nonce }), this.$t('components.registration.email-nonce.form.validations.success', {
email,
nonce,
}),
) )
} else {
this.$toast.error(
this.$t('components.registration.email-nonce.form.validations.error', {
email,
nonce,
}),
)
}
} }
} catch (err) { } catch (err) {
this.sliderData.setSliderValuesCallback(false, { this.sliderData.setSliderValuesCallback(false, {

View File

@ -168,9 +168,10 @@
"description": "Öffne Dein E-Mail Postfach und gib den Code ein, den wir geschickt haben.", "description": "Öffne Dein E-Mail Postfach und gib den Code ein, den wir geschickt haben.",
"next": "Weiter", "next": "Weiter",
"nonce": "E-Mail-Code: 32143", "nonce": "E-Mail-Code: 32143",
"success": "Gültiger Bestätigungs-Code <b>{nonce}</b> für E-Mail <b>{email}</b>!",
"validations": { "validations": {
"length": "muss genau 5 Buchstaben lang sein" "error": "Ungültiger Bestätigungs-Code <b>{nonce}</b> für E-Mail <b>{email}</b>!",
"length": "muss genau 5 Buchstaben lang sein",
"success": "Gültiger Bestätigungs-Code <b>{nonce}</b> für E-Mail <b>{email}</b>!"
} }
}, },
"title": "E-Mail Bestätigung" "title": "E-Mail Bestätigung"
@ -181,9 +182,10 @@
"description": "Gib den Einladungs-Code ein, den du bekommen hast.", "description": "Gib den Einladungs-Code ein, den du bekommen hast.",
"invite-code": "Einladungs-Code: ACJERB", "invite-code": "Einladungs-Code: ACJERB",
"next": "Weiter", "next": "Weiter",
"success": "Gültiger Einladungs-Code <b>{inviteCode}</b>!",
"validations": { "validations": {
"length": "muss genau 6 Buchstaben lang sein" "error": "Ungültiger Einladungs-Code <b>{inviteCode}</b>!",
"length": "muss genau 6 Buchstaben lang sein",
"success": "Gültiger Einladungs-Code <b>{inviteCode}</b>!"
} }
} }
}, },

View File

@ -168,9 +168,10 @@
"description": "Open your inbox and enter the code that we've sent to you.", "description": "Open your inbox and enter the code that we've sent to you.",
"next": "Continue", "next": "Continue",
"nonce": "E-mail code: 32143", "nonce": "E-mail code: 32143",
"success": "Valid verification code <b>{nonce}</b> for e-mail <b>{email}</b>!",
"validations": { "validations": {
"length": "must be 5 characters long" "error": "Invalid verification code <b>{nonce}</b> for e-mail <b>{email}</b>!",
"length": "must be 5 characters long",
"success": "Valid verification code <b>{nonce}</b> for e-mail <b>{email}</b>!"
} }
}, },
"title": "E-Mail Confirmation" "title": "E-Mail Confirmation"
@ -181,9 +182,10 @@
"description": "Enter the invitation code you received.", "description": "Enter the invitation code you received.",
"invite-code": "Invite code: ACJERB", "invite-code": "Invite code: ACJERB",
"next": "Continue", "next": "Continue",
"success": "Valid invite code <b>{inviteCode}</b>!",
"validations": { "validations": {
"length": "must be 6 characters long" "error": "Invalid invite code <b>{inviteCode}</b>!",
"length": "must be 6 characters long",
"success": "Valid invite code <b>{inviteCode}</b>!"
} }
} }
}, },