Socket
Socket
Sign inDemoInstall

vue-google-drive-signin

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-google-drive-signin

A simple Vue directive to include Google Drive Sign-In Button behavior in any component.


Version published
Weekly downloads
13
increased by44.44%
Maintainers
1
Install size
5.81 kB
Created
Weekly downloads
 

Readme

Source

vue-google-drive-signin

A simple Vue directive to include Google Sign-In Button behavior in any component.

Install

$ npm install --save vue-google-drive-signin

$ yarn add vue-google-drive-signin

Usage

Import the directive and attach it to any component.

Example:

Important: OnGoogleAuthSuccess and OnGoogleAuthFail are mandatory methods you have to declare in your component where you are using the directive.

<template>
  <button v-google-signin-button="clientId" class="google-signin-button">Continue with Google</button>
</template>

<script>
import GoogleSignInButton from 'vue-google-signin-button-directive'
export default {
  directives: {
    GoogleSignInButton
  },
  data: () => ({
    clientId: 'Your_Google_Client_ID'
  }),
  methods: {
    OnGoogleAuthSuccess (authData) {
      // Receive the authenticated data (access_token, id token ...) and make your magic with the backend

    },
    OnGoogleAuthFail (error) {
      console.log(error)
    }
  }
}
</script>

<style>
.google-signin-button {
  color: white;
  background-color: red;
  height: 50px;
  font-size: 16px;
  border-radius: 10px;
  padding: 10px 20px 25px 20px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
</style>

Happy coding.

Keywords

FAQs

Last updated on 25 Jun 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc