diff --git a/frontend/src/stores/user-store.js b/frontend/src/stores/user-store.js index 74f63aa62..2f7cd25a0 100644 --- a/frontend/src/stores/user-store.js +++ b/frontend/src/stores/user-store.js @@ -26,7 +26,7 @@ export const useUserStore = defineStore('user', { const { error, data } = await fetch('me').get().json(); // Failed to get profile data, log this user out and return false - if (error.value) { + if (error.value || !data.value) { this.reset(); return false; } @@ -47,7 +47,7 @@ export const useUserStore = defineStore('user', { async login(fetch, username, password) { this.reset(); - if (import.meta.env?.VUE_AUTH_SCHEME === 'password') { + if (import.meta.env.VITE_AUTH_SCHEME === 'password') { // fastapi wants us to send this as formdata :| const formData = new FormData(document.createElement('form')); formData.set('username', username);