From 9c4320e94aa92f445f5f38d279f82141833377f3 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Wed, 21 Jul 2021 09:34:04 +0200 Subject: [PATCH] Handle missing env in mixin --- client/src/mixins/logout.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/mixins/logout.js b/client/src/mixins/logout.js index 6982bc95..a7939d22 100644 --- a/client/src/mixins/logout.js +++ b/client/src/mixins/logout.js @@ -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(`/`); + } } }); }