gapi-oauth-react-hooks
Advanced tools
Comparing version 1.1.3 to 2.0.0
/// <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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132
18819