improve login & invite mechanics (#8574)

Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
This commit is contained in:
Ulf Gebhardt 2025-05-22 20:24:02 +02:00 committed by GitHub
parent 497dabdef9
commit 8f72c4282a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 49 additions and 83 deletions

View File

@ -171,9 +171,6 @@ export default {
}
},
mounted: function () {
this.$nextTick(function () {
// Code that will run only after the entire view has been rendered
this.formData.name = this.sliderData.collectedInputData.name
? this.sliderData.collectedInputData.name
: ''
@ -196,7 +193,6 @@ export default {
this.sliderData.setSliderValuesCallback(this.validInput, {
sliderSettings: { buttonSliderCallback: this.onNextClick },
})
})
},
computed: {
validInput() {

View File

@ -67,9 +67,6 @@ export default {
}
},
mounted: function () {
this.$nextTick(function () {
// Code that will run only after the entire view has been rendered
this.formData.email = this.sliderData.collectedInputData.email
? this.sliderData.collectedInputData.email
: ''
@ -81,7 +78,6 @@ export default {
buttonSliderCallback: this.onNextClick,
},
})
})
},
watch: {
sendEmailAgain() {

View File

@ -75,9 +75,6 @@ export default {
}
},
mounted: function () {
this.$nextTick(function () {
// Code that will run only after the entire view has been rendered
this.formData.inviteCode = this.sliderData.collectedInputData.inviteCode
? this.sliderData.collectedInputData.inviteCode
: ''
@ -86,7 +83,6 @@ export default {
this.sliderData.setSliderValuesCallback(this.validInput, {
sliderSettings: { buttonSliderCallback: this.onNextClick },
})
})
},
computed: {
sliderIndex() {
@ -96,12 +92,14 @@ export default {
return this.formData.inviteCode.length === 6
},
invitedBy() {
return this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode
return this.validInput &&
this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode
? this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode.generatedBy
: null
},
invitedTo() {
return this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode
return this.validInput &&
this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode
? this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode.invitedTo
: null
},
@ -124,18 +122,11 @@ export default {
async handleInputValid() {
this.sendValidation()
},
isVariablesRequested(variables) {
return (
this.sliderData.sliders[this.sliderIndex].data.request &&
this.sliderData.sliders[this.sliderIndex].data.request.variables &&
this.sliderData.sliders[this.sliderIndex].data.request.variables.code === variables.code
)
},
async handleSubmitVerify() {
const { inviteCode } = this.sliderData.collectedInputData
const variables = { code: inviteCode }
if (!this.isVariablesRequested(variables) && !this.dbRequestInProgress) {
if (!this.dbRequestInProgress) {
try {
this.dbRequestInProgress = true

View File

@ -18,13 +18,9 @@ export default {
sliderData: { type: Object, required: true },
},
mounted: function () {
this.$nextTick(function () {
// Code that will run only after the entire view has been rendered
this.sliderData.setSliderValuesCallback(true, {
sliderSettings: { buttonSliderCallback: this.onNextClick },
})
})
},
methods: {
onNextClick() {

View File

@ -66,9 +66,6 @@ export default {
}
},
mounted: function () {
this.$nextTick(function () {
// Code that will run only after the entire view has been rendered
this.formData.nonce = this.sliderData.collectedInputData.nonce
? this.sliderData.collectedInputData.nonce
: ''
@ -77,7 +74,6 @@ export default {
this.sliderData.setSliderValuesCallback(this.validInput, {
sliderSettings: { buttonSliderCallback: this.onNextClick },
})
})
},
computed: {
sliderIndex() {
@ -109,20 +105,11 @@ export default {
async handleInputValid() {
this.sendValidation()
},
isVariablesRequested(variables) {
return (
this.sliderData.sliders[this.sliderIndex].data.request &&
this.sliderData.sliders[this.sliderIndex].data.request.variables &&
this.sliderData.sliders[this.sliderIndex].data.request.variables.email ===
variables.email &&
this.sliderData.sliders[this.sliderIndex].data.request.variables.nonce === variables.nonce
)
},
async handleSubmitVerify() {
const { email, nonce } = this.sliderData.collectedInputData
const variables = { email, nonce }
if (!this.isVariablesRequested(variables) && !this.dbRequestInProgress) {
if (!this.dbRequestInProgress) {
try {
this.dbRequestInProgress = true