Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gapi-oauth-react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gapi-oauth-react-hooks - npm Package Compare versions

Comparing version 1.1.3 to 2.0.0

hooks/use.google.auth.hook.d.ts

4

hooks/use.gapi.loading.hook.d.ts
/// <reference types="gapi.auth2" />
/// <reference types="react" />
import { GapiState } from "../types/gapiState";
interface UseGapiLoadingProps {
interface GapiLoadingProps {
state: GapiState;

@@ -12,3 +12,3 @@ signedUser?: gapi.auth2.BasicProfile;

}
export declare const useGapiLoading: () => UseGapiLoadingProps;
export declare const useGapiLoading: () => GapiLoadingProps;
export {};

@@ -1,5 +0,5 @@

import { useGapiLogin } from "./hooks/use.gapi.login.hook";
import { useGoogleAuth } from "./hooks/use.google.auth.hook";
import { GapiConfig } from "./logic/gapi.config.logic";
import { GapiState } from "./types/gapiState";
export { useGapiLogin, GapiConfig };
export { useGoogleAuth, GapiConfig };
export type { GapiState };

@@ -1,3 +0,3 @@

import { useGapiLogin } from "./hooks/use.gapi.login.hook";
import { useGoogleAuth } from "./hooks/use.google.auth.hook";
import { GapiConfig } from "./logic/gapi.config.logic";
export { useGapiLogin, GapiConfig };
export { useGoogleAuth, GapiConfig };
{
"name": "gapi-oauth-react-hooks",
"version": "1.1.3",
"version": "2.0.0",
"repository": "https://github.com/jpb06/gapi-oauth-react-hooks.git",

@@ -5,0 +5,0 @@ "author": "jpb06 <jpb.06@outlook.com>",

@@ -48,3 +48,3 @@ # gapi-oauth-react-hooks

```Typescript
import { useGapiLogin } from "gapi-oauth-react-hooks";
import { useGoogleAuth } from "gapi-oauth-react-hooks";

@@ -56,10 +56,10 @@ export const Login = () => {

authResponse,
onGoogleSignIn,
onGoogleSignOut
} = useGapiLogin();
onSignIn,
onSignOut
} = useGoogleAuth();
const display = {
Loading: <>Well, gapi is being loaded...</>,
SignedIn: <SignedIn user={signedUser} authResponse={authResponse} onSignOut={onGoogleSignOut} />,
NotSignedIn: <SimpleButton onClick={onGoogleSignIn} text="Login" />,
SignedIn: <SignedIn user={signedUser} authResponse={authResponse} onSignOut={onSignOut} />,
NotSignedIn: <SimpleButton onClick={onSignIn} text="Login" />,
Errored: <>Oh no!</>,

@@ -114,7 +114,8 @@ };

- authResponse : the google auth response.
- onGoogleSignIn : The signin function.
- onGoogleSignOut : The signout function.
- onSignIn : The signin function.
- onSignOut : The signout function.
## Log
- 2.0.0 : Main hook renamed to useGoogleAuth.
- 1.1.3 : Minor readme improvements.

@@ -121,0 +122,0 @@ - 1.1.2 : Using 'On' prefix convention for outgoing events.

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc