Handle missing env in mixin

This commit is contained in:
Christian Cueni 2021-07-21 09:34:04 +02:00
parent b5de0b582c
commit 9c4320e94a
1 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,11 @@ export default {
mutation: LOGOUT_MUTATION,
}).then(({data}) => {
if (data.logout.success) {
location.replace(`https://sso.hep-verlag.ch/logout?return_to=${process.env.LOGOUT_REDIRECT_URL}`);
if (process.env.LOGOUT_REDIRECT_URL) {
location.replace(`https://sso.hep-verlag.ch/logout?return_to=${process.env.LOGOUT_REDIRECT_URL}`);
} else {
location.replace(`/`);
}
}
});
}