Redirect to hello, add redirect query param

This commit is contained in:
Christian Cueni 2020-02-18 16:32:12 +01:00
parent e067717d50
commit e9713c736b
5 changed files with 6 additions and 9 deletions

View File

@ -42,7 +42,6 @@ export default function (uri, networkErrorCallback) {
});
const errorLink = onError(({response, operation, networkError, graphQLErrors}) => {
if (networkError && networkErrorCallback) {
networkErrorCallback(networkError.statusCode);
return Observable.of();

View File

@ -155,12 +155,12 @@ function networkErrorCallback(statusCode) {
router.beforeEach(async (to, from, next) => {
if (to.path === '/logout') {
privateApolloClient.resetStore();
next({name: 'login'});
next({name: 'hello'});
return;
}
if (unauthorizedAccess(to)) {
const redirectUrl = `/login?redirect=${to.path}`;
const redirectUrl = `/hello?redirect=${to.path}`;
next(redirectUrl);
return;
}

View File

@ -56,14 +56,14 @@ export default {
} else {
this.$router.push('/');
}
} else {
switch (data.registration.errors[0].field) {
case 'invalid_key':
this.errorMessage = 'Der angegebene Verifizierungscode ist falsch oder abgelaufen.';
break;
case 'no_valid_license':
this.$router.push({name: 'licenseActivation'})
this.$router.push({name: 'licenseActivation'});
break;
default:
this.errorMessage = 'Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.';
}

View File

@ -56,9 +56,8 @@ export default {
variables: {
helloEmail: this.email
}
})
this.$router.push({name: redirectRouteName});
});
this.$router.push({name: redirectRouteName, query: this.$route.query});
})
.catch(() => {
this.registrationError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals.';

View File

@ -48,7 +48,6 @@ export default {
validateBeforeSubmit() {
this.$validator.validate().then(result => {
this.submitted = true;
let that = this;
if (result) {
login(this.helloEmail.email, this.password)
.then((response) => {