Redirect to hello, add redirect query param
This commit is contained in:
parent
e067717d50
commit
e9713c736b
|
|
@ -42,7 +42,6 @@ export default function (uri, networkErrorCallback) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const errorLink = onError(({response, operation, networkError, graphQLErrors}) => {
|
const errorLink = onError(({response, operation, networkError, graphQLErrors}) => {
|
||||||
|
|
||||||
if (networkError && networkErrorCallback) {
|
if (networkError && networkErrorCallback) {
|
||||||
networkErrorCallback(networkError.statusCode);
|
networkErrorCallback(networkError.statusCode);
|
||||||
return Observable.of();
|
return Observable.of();
|
||||||
|
|
|
||||||
|
|
@ -155,12 +155,12 @@ function networkErrorCallback(statusCode) {
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
if (to.path === '/logout') {
|
if (to.path === '/logout') {
|
||||||
privateApolloClient.resetStore();
|
privateApolloClient.resetStore();
|
||||||
next({name: 'login'});
|
next({name: 'hello'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unauthorizedAccess(to)) {
|
if (unauthorizedAccess(to)) {
|
||||||
const redirectUrl = `/login?redirect=${to.path}`;
|
const redirectUrl = `/hello?redirect=${to.path}`;
|
||||||
next(redirectUrl);
|
next(redirectUrl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,14 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('/');
|
this.$router.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
switch (data.registration.errors[0].field) {
|
switch (data.registration.errors[0].field) {
|
||||||
case 'invalid_key':
|
case 'invalid_key':
|
||||||
this.errorMessage = 'Der angegebene Verifizierungscode ist falsch oder abgelaufen.';
|
this.errorMessage = 'Der angegebene Verifizierungscode ist falsch oder abgelaufen.';
|
||||||
break;
|
break;
|
||||||
case 'no_valid_license':
|
case 'no_valid_license':
|
||||||
this.$router.push({name: 'licenseActivation'})
|
this.$router.push({name: 'licenseActivation'});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
this.errorMessage = 'Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.';
|
this.errorMessage = 'Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,8 @@ export default {
|
||||||
variables: {
|
variables: {
|
||||||
helloEmail: this.email
|
helloEmail: this.email
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
this.$router.push({name: redirectRouteName, query: this.$route.query});
|
||||||
this.$router.push({name: redirectRouteName});
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.registrationError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals.';
|
this.registrationError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals.';
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ export default {
|
||||||
validateBeforeSubmit() {
|
validateBeforeSubmit() {
|
||||||
this.$validator.validate().then(result => {
|
this.$validator.validate().then(result => {
|
||||||
this.submitted = true;
|
this.submitted = true;
|
||||||
let that = this;
|
|
||||||
if (result) {
|
if (result) {
|
||||||
login(this.helloEmail.email, this.password)
|
login(this.helloEmail.email, this.password)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue