
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
google-login-vue3
Advanced tools
A lightweight and customizable Vue 3 component for Google OAuth 2.0 authentication, supporting both code-based and JWT-based authentication modes.
A lightweight and customizable Vue 3 component for Google OAuth 2.0 authentication supporting both JWT-based and Authorization Code-based flows.
npm install google-login-vue3
<template>
<GoogleLogin
:clientId="YOUR_GOOGLE_CLIENT_ID"
mode="JWT"
:oneTapLogin="true"
@success="handleSuccess"
@error="handleError"
/>
<!-- Optional: mode="JWT" (default) or "code" -->
<!-- Optional: Enables Google One Tap (:oneTapLogin="true") in JWT mode -->
</template>
<script setup>
import GoogleLogin from "google-login-vue3";
const handleSuccess = (response) => {
console.log("Success response:", response);
if (response.credential) {
console.log("JWT Token:", response.credential);
// Send the token to your backend for verification
} else if (response.code) {
console.log("Authorization Code:", response.code);
// Send the code to your backend for access token exchange
}
};
const handleError = (error) => {
console.error("Google login error:", error);
};
</script>
Replace
YOUR_GOOGLE_CLIENT_ID
with your actual client ID from Google Developer Console.
oneTapLogin
prop.Prop | Type | Default | Description |
---|---|---|---|
clientId | String | β | Required. Your Google OAuth 2.0 client ID. |
mode | String | "JWT" | "JWT" or "code" depending on the flow you want to use. |
oneTapLogin | Boolean | true | Enables Google One Tap login (only valid in JWT mode). |
code
mode, you can customize the login button using the default slot.Example:
<GoogleLogin mode="code" :clientId="clientId">
<template #default>
<button class="my-custom-btn">Sign in with Google</button>
</template>
</GoogleLogin>
mode="code"
)google-auth-library
google-auth
success
and error
events properly.Contributions are welcome! Feel free to:
Shiv Baran Singh
π§ spyshiv@gmail.com
π GitHub
FAQs
A lightweight and customizable Vue 3 component for Google OAuth 2.0 authentication, supporting both code-based and JWT-based authentication modes.
The npm package google-login-vue3 receives a total of 5 weekly downloads. As such, google-login-vue3 popularity was classified as not popular.
We found that google-login-vue3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.