We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
How can i use this with pinia? I tried this code. But this gives errors that it cannot fetch when i try to login.
`// stores/auth.js
import { defineStore } from 'pinia'; import { ref, computed } from 'vue'; import { useSupabaseClient } from '#imports';
export const useAuthStore = defineStore('auth', () => { const supabase = useSupabaseClient(); const user = ref(null); const error = ref(null);
const isAuthenticated = computed(() => !!user.value);
const signIn = async (email, password) => { try { const { data, error: signInError } = await supabase.auth.signInWithPassword({ email, password, }); if (signInError) throw signInError; user.value = data.user; } catch (err) { error.value = err.message; } };
return { user, error, isAuthenticated, signIn }; }); `
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
How can i use this with pinia?
I tried this code. But this gives errors that it cannot fetch when i try to login.
`// stores/auth.js
import { defineStore } from 'pinia';
import { ref, computed } from 'vue';
import { useSupabaseClient } from '#imports';
export const useAuthStore = defineStore('auth', () => {
const supabase = useSupabaseClient();
const user = ref(null);
const error = ref(null);
const isAuthenticated = computed(() => !!user.value);
const signIn = async (email, password) => {
try {
const { data, error: signInError } = await supabase.auth.signInWithPassword({
email,
password,
});
if (signInError) throw signInError;
user.value = data.user;
} catch (err) {
error.value = err.message;
}
};
return { user, error, isAuthenticated, signIn };
});
`
The text was updated successfully, but these errors were encountered: