fix: bypass auth redirect cookie when set to homepage

This commit is contained in:
NGPixel
2020-10-03 17:11:34 -04:00
parent 0fa5b9750d
commit fe890979af
2 changed files with 12 additions and 3 deletions

View File

@@ -644,7 +644,10 @@ export default {
Cookies.set('jwt', respObj.jwt, { expires: 365 })
_.delay(() => {
const loginRedirect = Cookies.get('loginRedirect')
if (loginRedirect) {
if (loginRedirect === '/' && respObj.redirect) {
Cookies.remove('loginRedirect')
window.location.replace(respObj.redirect)
} else if (loginRedirect) {
Cookies.remove('loginRedirect')
window.location.replace(loginRedirect)
} else if (respObj.redirect) {