mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Add query to the queries file, add method that checks if optin code is valid else push to password reset page.
This commit is contained in:
parent
4105191b04
commit
21504e8005
@ -127,3 +127,9 @@ export const communities = gql`
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const queryOptIn = gql`
|
||||
query($optIn: String!) {
|
||||
queryOptIn(optIn: $optIn)
|
||||
}
|
||||
`
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
<script>
|
||||
import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirmation'
|
||||
import { setPassword } from '@/graphql/mutations'
|
||||
import { queryOptIn } from '@/graphql/queries'
|
||||
|
||||
const textFields = {
|
||||
reset: {
|
||||
@ -104,7 +105,22 @@ export default {
|
||||
this.$router.push('/forgot-password/resetPassword')
|
||||
})
|
||||
},
|
||||
checkOptInCode() {
|
||||
this.$apollo
|
||||
.query({
|
||||
query: queryOptIn,
|
||||
variables: {
|
||||
optIn: this.$route.params.optin,
|
||||
},
|
||||
})
|
||||
.then()
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
this.$router.push('/forgot-password/resetPassword')
|
||||
})
|
||||
},
|
||||
setDisplaySetup() {
|
||||
this.checkOptInCode()
|
||||
if (this.$route.path.includes('checkEmail')) {
|
||||
this.displaySetup = textFields.checkEmail
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user