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
|
|
@ -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
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue