mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +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,31 +171,27 @@ 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
|
||||
: ''
|
||||
this.formData.password = this.sliderData.collectedInputData.password
|
||||
? this.sliderData.collectedInputData.password
|
||||
: ''
|
||||
this.formData.passwordConfirmation = this.sliderData.collectedInputData.passwordConfirmation
|
||||
? this.sliderData.collectedInputData.passwordConfirmation
|
||||
: ''
|
||||
this.termsAndConditionsConfirmed = this.sliderData.collectedInputData
|
||||
.termsAndConditionsConfirmed
|
||||
? this.sliderData.collectedInputData.termsAndConditionsConfirmed
|
||||
: false
|
||||
this.recieveCommunicationAsEmailsEtcConfirmed = this.sliderData.collectedInputData
|
||||
.recieveCommunicationAsEmailsEtcConfirmed
|
||||
? this.sliderData.collectedInputData.recieveCommunicationAsEmailsEtcConfirmed
|
||||
: false
|
||||
this.sendValidation()
|
||||
|
||||
this.formData.name = this.sliderData.collectedInputData.name
|
||||
? this.sliderData.collectedInputData.name
|
||||
: ''
|
||||
this.formData.password = this.sliderData.collectedInputData.password
|
||||
? this.sliderData.collectedInputData.password
|
||||
: ''
|
||||
this.formData.passwordConfirmation = this.sliderData.collectedInputData.passwordConfirmation
|
||||
? this.sliderData.collectedInputData.passwordConfirmation
|
||||
: ''
|
||||
this.termsAndConditionsConfirmed = this.sliderData.collectedInputData
|
||||
.termsAndConditionsConfirmed
|
||||
? this.sliderData.collectedInputData.termsAndConditionsConfirmed
|
||||
: false
|
||||
this.recieveCommunicationAsEmailsEtcConfirmed = this.sliderData.collectedInputData
|
||||
.recieveCommunicationAsEmailsEtcConfirmed
|
||||
? this.sliderData.collectedInputData.recieveCommunicationAsEmailsEtcConfirmed
|
||||
: false
|
||||
this.sendValidation()
|
||||
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
|
||||
@ -67,20 +67,16 @@ 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
|
||||
: ''
|
||||
this.sendValidation()
|
||||
|
||||
this.formData.email = this.sliderData.collectedInputData.email
|
||||
? this.sliderData.collectedInputData.email
|
||||
: ''
|
||||
this.sendValidation()
|
||||
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: {
|
||||
...this.buttonValues().sliderSettings,
|
||||
buttonSliderCallback: this.onNextClick,
|
||||
},
|
||||
})
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: {
|
||||
...this.buttonValues().sliderSettings,
|
||||
buttonSliderCallback: this.onNextClick,
|
||||
},
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -75,17 +75,13 @@ 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
|
||||
: ''
|
||||
this.sendValidation()
|
||||
|
||||
this.formData.inviteCode = this.sliderData.collectedInputData.inviteCode
|
||||
? this.sliderData.collectedInputData.inviteCode
|
||||
: ''
|
||||
this.sendValidation()
|
||||
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
@ -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,12 +18,8 @@ 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 },
|
||||
})
|
||||
this.sliderData.setSliderValuesCallback(true, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -66,17 +66,13 @@ 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
|
||||
: ''
|
||||
this.sendValidation()
|
||||
|
||||
this.formData.nonce = this.sliderData.collectedInputData.nonce
|
||||
? this.sliderData.collectedInputData.nonce
|
||||
: ''
|
||||
this.sendValidation()
|
||||
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
@ -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