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 2.0.3 to 2.0.4

logic/conversion.logic.d.ts

5

hooks/use.gapi.loading.hook.d.ts
/// <reference types="gapi.auth2" />
/// <reference types="react" />
import { GapiState } from "../types/gapiState";
import { UserProfile } from "../types/user.profile";
interface GapiLoadingHookProps {
state: GapiState;
signedUser?: gapi.auth2.BasicProfile;
signedUser?: UserProfile;
authResponse?: gapi.auth2.AuthResponse;
setState: React.Dispatch<React.SetStateAction<GapiState>>;
setSignedUser: React.Dispatch<React.SetStateAction<gapi.auth2.BasicProfile | undefined>>;
setSignedUser: React.Dispatch<React.SetStateAction<UserProfile | undefined>>;
setAuthResponse: React.Dispatch<React.SetStateAction<gapi.auth2.AuthResponse | undefined>>;

@@ -11,0 +12,0 @@ }

@@ -38,3 +38,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { useEffect, useState } from "react";
import { gapiAuth2Init, gapiGetAuth2Instance, gapiLoad } from "../indirection/gapi.lib.indirection";
import { gapiAuth2Init, gapiGetAuth2Instance, gapiLoad, } from "../indirection/gapi.lib.indirection";
import { asPlainObject } from "../logic/conversion.logic";
import { loadScript, removeScript } from "../logic/resource.loading.logic";

@@ -51,3 +52,3 @@ import { useGapiConfig } from "./use.gapi.config.hook";

setAuthResponse(currentUser.getAuthResponse());
setSignedUser(currentUser.getBasicProfile());
setSignedUser(asPlainObject(currentUser.getBasicProfile()));
setState("SignedIn");

@@ -54,0 +55,0 @@ }

3

hooks/use.google.auth.hook.d.ts
/// <reference types="gapi.auth2" />
import { GapiState } from "../types/gapiState";
import { UserProfile } from "../types/user.profile";
export interface GoogleAuthHookProps {
state: GapiState;
signedUser?: gapi.auth2.BasicProfile;
signedUser?: UserProfile;
authResponse?: gapi.auth2.AuthResponse;

@@ -7,0 +8,0 @@ onSignIn: () => Promise<void>;

@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { gapiGetAuth2Instance } from "../indirection/gapi.lib.indirection";
import { asPlainObject } from "../logic/conversion.logic";
import { useGapiLoading } from "./use.gapi.loading.hook";

@@ -57,3 +58,3 @@ export var useGoogleAuth = function () {

setAuthResponse(user.getAuthResponse());
setSignedUser(user.getBasicProfile());
setSignedUser(asPlainObject(user.getBasicProfile()));
setState("SignedIn");

@@ -60,0 +61,0 @@ return [3 /*break*/, 4];

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

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

import { useGoogleAuth } from "./hooks/use.google.auth.hook";
import { useGoogleAuth, } from "./hooks/use.google.auth.hook";
import { GapiConfig } from "./logic/gapi.config.logic";
export { useGoogleAuth, GapiConfig };
{
"name": "gapi-oauth-react-hooks",
"version": "2.0.3",
"version": "2.0.4",
"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 { useGoogleAuth } from "gapi-oauth-react-hooks";
import { useGoogleAuth, UserProfile } from "gapi-oauth-react-hooks";

@@ -66,3 +66,3 @@ export const Login = () => {

onSignOut: () => Promise<void>;
signedUser?: gapi.auth2.BasicProfile;
signedUser?: UserProfile;
authResponse?: gapi.auth2.AuthResponse;

@@ -113,2 +113,3 @@ }

- 2.0.4 : Returning a plain object for user profile.
- 2.0.3 : Yet another readme example improvement.

@@ -115,0 +116,0 @@ - 2.0.2 : Typo & missing export in index.

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