mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
improve login & invite mechanics (#8574)
Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
This commit is contained in:
parent
497dabdef9
commit
8f72c4282a
@ -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() {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user