svelte-social-auth icon indicating copy to clipboard operation
svelte-social-auth copied to clipboard

Can't get Google OAuth to work

Open diogox opened this issue 3 years ago • 2 comments

Hi :wave:

First of all, I'm not sure if this a problem with the library itself. I might be missing something here.

If that is the case, I would really appreciate it if you could still take the time to help me out and perhaps this issue might serve as documentation to others in the future.

So, the problem I'm getting is the following:

  • I've set up the code like the README file exemplifies.
  • When I click the button, it opens the Google page for the user's consent.
  • After consenting, the page closes.
  • Nothing happens on my page. It doesn't redirect, it doesn't log anything.

Here's what the code looks like:

<script lang="ts">
    import Tailwindcss from '../Tailwindcss.svelte';
    import { GoogleAuth } from '@beyonk/svelte-social-auth';
</script>

<style>

</style>

<Tailwindcss/>

<main>
    <div class="bg-white">
        <h1>Login</h1>
        <br/>
        <GoogleAuth clientId={process.env.OAUTH_GOOGLE_CLIENT_ID}
                    on:auth-success={e => console.log(e.detail.user)}
                    on:auth-failure={e => console.log(e)}
        />
    </div>
</main>

I can't figure out why it's not working... Do you see what might be causing this issue?

Thanks in advance :)

diogox avatar Sep 08 '20 21:09 diogox

Apologies, I managed to not spot any issues at all on this repository!

I'm assuming that after a year you have found a solution to this or another library?

antony avatar Nov 01 '21 22:11 antony

No problem ^^

I think I dropped whatever I was working on at some point, but I recall figuring out that this worked fine when in incognito mode. Meaning it was most likely one of my extensions causing the issue.

I've also seen this behavior on some pretty high-level websites, so it's probably safe to close this issue :)

diogox avatar Nov 02 '21 00:11 diogox