mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Temporary commit
This commit is contained in:
parent
2b634b8706
commit
592a682bd7
@ -8,33 +8,7 @@ export default {
|
||||
return result
|
||||
},
|
||||
UpdateUser: async (resolve, root, args, context, info) => {
|
||||
const { currentUser } = context
|
||||
if (
|
||||
!!currentUser &&
|
||||
!!args.termsAndConditionsAgreedVersion &&
|
||||
args.termsAndConditionsAgreedVersion
|
||||
) {
|
||||
const session = context.driver.session()
|
||||
const cypher = `
|
||||
MATCH (user: User { id: $userId})
|
||||
SET user.termsAndConditionsAgreedAt = $createdAt
|
||||
SET user.termsAndConditionsAgreedVersion = $version
|
||||
RETURN user { .termsAndConditionsAgreedAt, .termsAndConditionsAgreedVersion }
|
||||
`
|
||||
const variable = {
|
||||
userId: currentUser.id,
|
||||
createdAt: new Date().toISOString(),
|
||||
version: args.termsAndConditionsAgreedVersion,
|
||||
}
|
||||
await session.run(cypher, variable)
|
||||
// console.log('Nach dem speichern')
|
||||
// console.log(transactionResult)
|
||||
// console.log('-------------------------------------')
|
||||
session.close()
|
||||
}
|
||||
|
||||
const result = await resolve(root, args, context, info)
|
||||
|
||||
await createOrUpdateLocations(args.id, args.locationName, context.driver)
|
||||
return result
|
||||
},
|
||||
|
||||
@ -84,6 +84,7 @@ import gql from 'graphql-tag'
|
||||
import PasswordStrength from '../Password/Strength'
|
||||
import { SweetalertIcon } from 'vue-sweetalert-icons'
|
||||
import PasswordForm from '~/components/utils/PasswordFormHelper'
|
||||
/* TODO: hier muss die version rein */
|
||||
export const SignupVerificationMutation = gql`
|
||||
mutation($nonce: String!, $name: String!, $email: String!, $password: String!) {
|
||||
SignupVerification(nonce: $nonce, email: $email, name: $name, password: $password) {
|
||||
|
||||
@ -26,11 +26,12 @@ export default async ({ store, env, route, redirect }) => {
|
||||
|
||||
// set the redirect path for after the login
|
||||
let params = {}
|
||||
if (!isEmpty(route.path) && route.path !== '/') {
|
||||
if (!isEmpty(route.path) && route.path !== '/' && route.path !== 'terms-and-conditions-confirm') {
|
||||
params.path = route.path
|
||||
}
|
||||
|
||||
console.log("ÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖö")
|
||||
if (!upToDate) {
|
||||
console.log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
||||
return redirect('/terms-and-conditions-confirm', params)
|
||||
} else {
|
||||
return redirect('/login', params)
|
||||
|
||||
@ -75,6 +75,7 @@
|
||||
|
||||
<script>
|
||||
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
|
||||
import { VERSION } from '~/pages/terms-and-conditions'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -96,7 +97,7 @@ export default {
|
||||
},
|
||||
},
|
||||
asyncData({ store, redirect }) {
|
||||
if (store.getters['auth/isLoggedIn']) {
|
||||
if (store.getters['auth/user'].termsAndConditionsAgreedVersion === VERSION) {
|
||||
redirect('/')
|
||||
}
|
||||
},
|
||||
|
||||
@ -73,6 +73,15 @@ export default {
|
||||
],
|
||||
}
|
||||
},
|
||||
asyncData({ store, redirect }) {
|
||||
console.log('store')
|
||||
console.log(store)
|
||||
console.log('redirect')
|
||||
console.log(redirect)
|
||||
if (store.getters['auth/isLoggedIn']) {
|
||||
redirect('/')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async submit() {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user