Pass redirect URI from the App component rather than only having access to it in the login view.
This commit is contained in:
parent
7776ae80f0
commit
b76cb8070a
4 changed files with 26 additions and 9 deletions
11
src/App.vue
11
src/App.vue
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue