0
0
Fork 0

Pass redirect URI from the App component rather than only having access to it in the login view.

This commit is contained in:
Tyler-A 2020-08-05 20:51:25 -06:00
parent 7776ae80f0
commit b76cb8070a
4 changed files with 26 additions and 9 deletions

View file

@ -1,8 +1,9 @@
<template>
<div class="maximize_size">
<LoginCard v-if="!is_authed" />
<LoginCard v-if="!is_authed" :redirect="auth.redirect" />
<MainView
v-else
:auth_redirect="auth.redirect"
:preview_mode="is_preview"
:dev_mode="is_dev"
/>
@ -20,7 +21,11 @@ export default {
"LoginCard": LoginCard,
"MainView": MainView
},
data() { return {} },
data() { return {
auth: {
redirect: process.env.NODE_ENV === `production` ? `https://oliver.akins.me/top-lists` : `http://localhost:8080`
}
} },
computed: {
is_dev() {
let params = new URLSearchParams(window.location.search.slice(1));
@ -53,7 +58,7 @@ export default {
return true
}
} else {
let error = (new URLSearchParams(window.location.search)).get(`error`)
let error = (new URLSearchParams(window.location.search.slice(1))).get(`error`)
// Authorization failed, error to the user
if (error !== null) {