Now correctly redirect to /@your_page or / when login
This commit is contained in:
@@ -49,17 +49,6 @@ const errorSnackBar = ref(false);
|
||||
const showEmailForm = ref(false);
|
||||
const showPassword = ref(false);
|
||||
|
||||
const props = defineProps({
|
||||
onSuccess: {
|
||||
type: Function,
|
||||
required: true
|
||||
},
|
||||
onFailure: {
|
||||
type: Function,
|
||||
required: false
|
||||
}
|
||||
});
|
||||
|
||||
async function googleCallback(token) {
|
||||
const response = await authStore.loginWithGoogle(JSON.stringify(token));
|
||||
handleResponse(response)
|
||||
@@ -71,12 +60,7 @@ async function login() {
|
||||
}
|
||||
|
||||
function handleResponse(response) {
|
||||
if (response === true) {
|
||||
props.onSuccess();
|
||||
} else {
|
||||
if (props.onFailure) {
|
||||
props.onFailure();
|
||||
}
|
||||
if (response !== true) {
|
||||
errorSnackBar.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user