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

@ -96,6 +96,10 @@ export default {
type: String,
required: true,
},
auth_redirect: {
type: String,
required: true,
}
},
components: {
icon: Icon,
@ -174,7 +178,7 @@ export default {
).then((response) => {
if (response.error) {
window.location.hash = ``;
window.location.href = `${this.auth.redirect}?error=${encodeURI(response.error)}`;
window.location.href = `${this.auth_redirect}?error=${encodeURI(response.error)}`;
return
}
let data = response.data;
@ -184,8 +188,9 @@ export default {
this.user.image = data.images.length > 0 ? data.images[0].url : ``;
}).catch((err) => {
console/error(err)
window.location.hash = ``;
window.location.href = `${this.auth.redirect}?error=${encodeURI(err)}`;;
window.location.href = `${this.auth_redirect}?error=${encodeURI(err)}`;;
return
})
});