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,31 +171,27 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.formData.name = this.sliderData.collectedInputData.name
|
||||||
// Code that will run only after the entire view has been rendered
|
? 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.setSliderValuesCallback(this.validInput, {
|
||||||
? this.sliderData.collectedInputData.name
|
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||||
: ''
|
|
||||||
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 },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -67,20 +67,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.formData.email = this.sliderData.collectedInputData.email
|
||||||
// Code that will run only after the entire view has been rendered
|
? this.sliderData.collectedInputData.email
|
||||||
|
: ''
|
||||||
|
this.sendValidation()
|
||||||
|
|
||||||
this.formData.email = this.sliderData.collectedInputData.email
|
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||||
? this.sliderData.collectedInputData.email
|
sliderSettings: {
|
||||||
: ''
|
...this.buttonValues().sliderSettings,
|
||||||
this.sendValidation()
|
buttonSliderCallback: this.onNextClick,
|
||||||
|
},
|
||||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
|
||||||
sliderSettings: {
|
|
||||||
...this.buttonValues().sliderSettings,
|
|
||||||
buttonSliderCallback: this.onNextClick,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@ -75,17 +75,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.formData.inviteCode = this.sliderData.collectedInputData.inviteCode
|
||||||
// Code that will run only after the entire view has been rendered
|
? this.sliderData.collectedInputData.inviteCode
|
||||||
|
: ''
|
||||||
|
this.sendValidation()
|
||||||
|
|
||||||
this.formData.inviteCode = this.sliderData.collectedInputData.inviteCode
|
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||||
? this.sliderData.collectedInputData.inviteCode
|
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||||
: ''
|
|
||||||
this.sendValidation()
|
|
||||||
|
|
||||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
|
||||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -96,12 +92,14 @@ export default {
|
|||||||
return this.formData.inviteCode.length === 6
|
return this.formData.inviteCode.length === 6
|
||||||
},
|
},
|
||||||
invitedBy() {
|
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
|
? this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode.generatedBy
|
||||||
: null
|
: null
|
||||||
},
|
},
|
||||||
invitedTo() {
|
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
|
? this.sliderData.sliders[this.sliderIndex].data.response.validateInviteCode.invitedTo
|
||||||
: null
|
: null
|
||||||
},
|
},
|
||||||
@ -124,18 +122,11 @@ export default {
|
|||||||
async handleInputValid() {
|
async handleInputValid() {
|
||||||
this.sendValidation()
|
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() {
|
async handleSubmitVerify() {
|
||||||
const { inviteCode } = this.sliderData.collectedInputData
|
const { inviteCode } = this.sliderData.collectedInputData
|
||||||
const variables = { code: inviteCode }
|
const variables = { code: inviteCode }
|
||||||
|
|
||||||
if (!this.isVariablesRequested(variables) && !this.dbRequestInProgress) {
|
if (!this.dbRequestInProgress) {
|
||||||
try {
|
try {
|
||||||
this.dbRequestInProgress = true
|
this.dbRequestInProgress = true
|
||||||
|
|
||||||
|
|||||||
@ -18,12 +18,8 @@ export default {
|
|||||||
sliderData: { type: Object, required: true },
|
sliderData: { type: Object, required: true },
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.sliderData.setSliderValuesCallback(true, {
|
||||||
// Code that will run only after the entire view has been rendered
|
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||||
|
|
||||||
this.sliderData.setSliderValuesCallback(true, {
|
|
||||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -66,17 +66,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$nextTick(function () {
|
this.formData.nonce = this.sliderData.collectedInputData.nonce
|
||||||
// Code that will run only after the entire view has been rendered
|
? this.sliderData.collectedInputData.nonce
|
||||||
|
: ''
|
||||||
|
this.sendValidation()
|
||||||
|
|
||||||
this.formData.nonce = this.sliderData.collectedInputData.nonce
|
this.sliderData.setSliderValuesCallback(this.validInput, {
|
||||||
? this.sliderData.collectedInputData.nonce
|
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
||||||
: ''
|
|
||||||
this.sendValidation()
|
|
||||||
|
|
||||||
this.sliderData.setSliderValuesCallback(this.validInput, {
|
|
||||||
sliderSettings: { buttonSliderCallback: this.onNextClick },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -109,20 +105,11 @@ export default {
|
|||||||
async handleInputValid() {
|
async handleInputValid() {
|
||||||
this.sendValidation()
|
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() {
|
async handleSubmitVerify() {
|
||||||
const { email, nonce } = this.sliderData.collectedInputData
|
const { email, nonce } = this.sliderData.collectedInputData
|
||||||
const variables = { email, nonce }
|
const variables = { email, nonce }
|
||||||
|
|
||||||
if (!this.isVariablesRequested(variables) && !this.dbRequestInProgress) {
|
if (!this.dbRequestInProgress) {
|
||||||
try {
|
try {
|
||||||
this.dbRequestInProgress = true
|
this.dbRequestInProgress = true
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user