Current user is coming null. Always I have setup Supa base and updated the file, still current user is coming null.
const getCurrentUser = async (userId: string) => {
try {
const { data: profile, error } = await supabaseClient
.from('profiles')
.select('*')
.eq('id', userId)
if (error) {
throw error;
}
if (profile) {
setCurrentUser(profile[0]);
}
} catch (error) {
console.error('Error fetching user profile:', error);
}
};
Current user is coming null. Always I have setup Supa base and updated the file, still current user is coming null.
const getCurrentUser = async (userId: string) => {
try {
const { data: profile, error } = await supabaseClient
.from('profiles')
.select('*')
.eq('id', userId)