Skip to content

No session created when working with 0Auth Clients #250

New issue

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

Closed
Acentrix-Jordan opened this issue Aug 29, 2023 · 7 comments
Closed

No session created when working with 0Auth Clients #250

Acentrix-Jordan opened this issue Aug 29, 2023 · 7 comments
Labels
bug Something isn't working Stale

Comments

@Acentrix-Jordan
Copy link

Version

@nuxtjs/supabase:v1.0.2
nuxt: v3.4.3

Reproduction Link

No link as I have downgraded the Supabase module down to 0.3.0 as per the tutorial I am following.

Steps to reproduce

  1. Create a project
  2. Add Google or Github OAuth authentication
  3. On the login.vue page try firing the function below
const supabase = useSupabaseClient();

const login = async () => {
	const { error } = await supabase.auth.signInWithOAuth({
		provider: "google",
	});

	if (error) {
		console.error(error);
	}
};

What is Expected?

The user is directed to the third party OAuth, performs authentication and then redirected to the application where a session is created.

What is actually happening?

We are successfully redirected to google/github to confirm auth, however when we get redirected back our app, no session is created.

The auth is tracked in supabase and the user is added but no google authentication has been tracked in google. (As if the request was never sent)

@Acentrix-Jordan Acentrix-Jordan added the bug Something isn't working label Aug 29, 2023
@SaulAbreu
Copy link

Same

@tomasmorello
Copy link

tomasmorello commented Sep 13, 2023

So after troubleshooting for a few minutes, I found that the issue seems to be related to the missing redirectTo option in the parameters:

options: {
      redirectTo: 'http://localhost:3000/confirm',
    },

Adding this option fixed the issue. However, I am not sure why it was causing problems in the first place. It seems that the URL configuration was being completely ignored.

@negativems
Copy link

negativems commented Sep 18, 2023

So after troubleshooting for a few minutes, I found that the issue seems to be related to the missing redirectTo option in the parameters:

options: {
      redirectTo: 'http://localhost:3000/confirm',
    },

Adding this option fixed the issue. However, I am not sure why it was causing problems in the first place. It seems that the URL configuration was being completely ignored.

Should this work without creating a /confirm page or it need to exists? I mean, could the /confirm page be the same as the login?

@tomasmorello
Copy link

So after troubleshooting for a few minutes, I found that the issue seems to be related to the missing redirectTo option in the parameters:

options: {
      redirectTo: 'http://localhost:3000/confirm',
    },

Adding this option fixed the issue. However, I am not sure why it was causing problems in the first place. It seems that the URL configuration was being completely ignored.

Should this work without creating a /confirm page or it need to exists? I mean, could the /confirm page be the same as the login?

I think it can't, but I would give it a try. Im afraid that could bring you an unexpected behavior sooner or later.

@felipemarcos
Copy link

I disabled ssr for the confirm page in nuxt.config.js and it works for me now.

routeRules: {
    "/confirm": { ssr: false },
},

Copy link

github-actions bot commented May 6, 2025

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label May 6, 2025
Copy link

github-actions bot commented Jun 5, 2025

This issue was closed because it has been stalled for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

5 participants