Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
react-google-auth
Advanced tools
Readme
Simple higher order component to load google js api, show login and handle sign in and sign out.
The gapi
object becomes available as a global as per normal Google's Javascript API behaviour.
yarn add react-google-auth
or npm install react-google-auth
import React from 'react';
import ReactGoogleAuth from 'react-google-auth';
function Example(props) {
console.log("gapi exists", gapi);
return <div>
<h1>App goes here</h1>
<button onClick={props.onSignOutClick}>Sign out</button>
</div>;
}
function Loader(props) {
return <div>Loading...</div>;
}
function SignIn(props) {
if(props.initializing) {
return <div className="Text Text-emphasis">Initializing...</div>;
}
if(props.error) {
console.log('Error', props.error);
return <div className="Text Text-strong">Error!</div>;
}
return <div>
<button className="Button Button-primary" onClick={props.onSignInClick}>Sign in</button>
{props.signingIn && <div>Signing in...</div>}
</div>;
}
export default ReactGoogleAuth({
clientId: "828692616521-a30cidgltv5cfhg8fbi344i9sqquj138.apps.googleusercontent.com",
discoveryDocs: ["https://sheets.googleapis.com/$discovery/rest?version=v4"],
loader: Loader,
scope: "https://www.googleapis.com/auth/spreadsheets",
signIn: SignIn
})(Example);
FAQs
Simple higher order component to load google js api, show login and handle sign in and sign out
The npm package react-google-auth receives a total of 0 weekly downloads. As such, react-google-auth popularity was classified as not popular.
We found that react-google-auth demonstrated a not healthy version release cadence and project activity because the last version was released 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
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.