devbaji / vue3-google-login

Add Sign In With Google feature to your Vue 3 application
https://github.com/devbaji/vue3-google-login/
MIT License
198 stars 30 forks source link

Uncaught (in promise) when want to sign in with google #60

Closed leoboom-isme closed 4 weeks ago

leoboom-isme commented 1 month ago

Can't seem to get this library to work.

My code:

<script setup>
    import { ref } from "vue";
    import Button from "@/components/ui/Button.vue";
    import { googleAuthCodeLogin } from "vue3-google-login"

    const googleClientId = ref(<client id text>);

    const googleLogin = () => {
        googleAuthCodeLogin({clientId: googleClientId}).then((response) => {
            console.log("Handle the response", response)
        })
    }
</script>

<template>
    <div>
        <p class="tw-text-light tw-text-center">Or sign in with</p>
        <div class="tw-mt-5 tw-grid tw-grid-cols-2 tw-gap-4">
            <Button @click="googleLogin" >
                <span>Google</span>
            </Button>
        </div>
    </div>
</template>

image

Vue: 3.4 vue3-google-login: 2.0.26

devbaji commented 1 month ago

@leoboom-isme In this line googleAuthCodeLogin({clientId: googleClientId}).then((response) => { Change googleClientId to googleClientId.value.

Inside Githubissues.

  • Githubissues is a development platform for aggregating issues.