logIn redirect to localhost
Hello guys. i have deployed site on netlify https://nuxt-ts.netlify.app/login. when i`m trying logIn with GitHub, it redirect me to localhost with access and refresh token. How to solve this problem?
You can redirect to your site by adding the parameter in your login method. See example below:
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github'
options: {
redirectTo: 'https://example.com/welcome'
}
})
You can check the docs for more info: https://supabase.com/docs/reference/javascript/auth-signinwithoauth
Then on your Supabase project, go to Authentication > URL Configuration then add your site URL to the Redirect URLs.
Now it just refresh the page and not giving authenticated user information `
const supabase = useSupabaseAuthClient();
const user = useSupabaseUser();
const location = useRuntimeConfig().public.siteUrl;
console.log(`${location}${query.redirectTo}`);
onMounted(() => {
watchEffect(async () => {
if (user.value) {
await navigateTo(query.redirectTo as string, {
replace: true,
});
}
});
});
const login = async (provider: 'github') => {
const redirectTo: string = `${location}${query.redirectTo}`;
const { error } = await supabase.auth.signInWithOAuth({
provider,
options: { redirectTo },
});
if (error) {
console.error(error);
}
};`
i mean, now it`s not even giving me access token. it was: like "localhost:3000#access_token=12312312" on deployment server. now even this disappear
supabase Site URL: http://localhost:3001/ Redirect URLs
https://nuxt-ts.netlify.app/ https://nuxt-ts.netlify.app/**
For property "redirectTo" try to write URL something like "http://localhost:3000/${location}${query.redirectTo} "