sheetgo-react-google-one-tap-sign-in
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -131,4 +131,9 @@ import { useState, useEffect, memo } from 'react'; | ||
function useGoogleOneTapLogin(_a) { | ||
var onError = _a.onError, disabled = _a.disabled, onSuccess = _a.onSuccess, googleAccountConfigs = _a.googleAccountConfigs; | ||
var onError = _a.onError, disabled = _a.disabled, onSuccess = _a.onSuccess, onMoment = _a.onMoment, googleAccountConfigs = _a.googleAccountConfigs; | ||
var script = useScript(googleClientScriptURL); | ||
var momentCallback = function({ g, h, j }) { | ||
if (onMoment && typeof onMoment === 'function') { | ||
onMoment(g, h, j); | ||
} | ||
} | ||
useEffect(function () { | ||
@@ -142,3 +147,3 @@ if (!(window === null || window === void 0 ? void 0 : window[scriptFlag]) && window.google && script === 'ready') { | ||
if ((window === null || window === void 0 ? void 0 : window[scriptFlag]) && script === 'ready' && !disabled) { | ||
window.google.accounts.id.prompt(); | ||
window.google.accounts.id.prompt(momentCallback); | ||
} | ||
@@ -145,0 +150,0 @@ }, [script, window === null || window === void 0 ? void 0 : window[scriptFlag], disabled]); |
@@ -135,3 +135,8 @@ (function (global, factory) { | ||
function useGoogleOneTapLogin(_a) { | ||
var onError = _a.onError, disabled = _a.disabled, onSuccess = _a.onSuccess, googleAccountConfigs = _a.googleAccountConfigs; | ||
var onError = _a.onError, disabled = _a.disabled, onSuccess = _a.onSuccess, onMoment = _a.onMoment, googleAccountConfigs = _a.googleAccountConfigs; | ||
var momentCallback = function({ g, h, j }) { | ||
if (onMoment && typeof onMoment === 'function') { | ||
onMoment(g, h, j); | ||
} | ||
} | ||
var script = useScript(googleClientScriptURL); | ||
@@ -146,3 +151,3 @@ react.useEffect(function () { | ||
if ((window === null || window === void 0 ? void 0 : window[scriptFlag]) && script === 'ready' && !disabled) { | ||
window.google.accounts.id.prompt(); | ||
window.google.accounts.id.prompt(momentCallback); | ||
} | ||
@@ -149,0 +154,0 @@ }, [script, window === null || window === void 0 ? void 0 : window[scriptFlag], disabled]); |
@@ -57,4 +57,9 @@ "use strict"; | ||
function useGoogleOneTapLogin(_a) { | ||
var onError = _a.onError, disabled = _a.disabled, onSuccess = _a.onSuccess, googleAccountConfigs = _a.googleAccountConfigs; | ||
var onError = _a.onError, disabled = _a.disabled, onSuccess = _a.onSuccess, onMoment = _a.onMoment, googleAccountConfigs = _a.googleAccountConfigs; | ||
var script = useScript_1.default(googleClientScriptURL); | ||
var momentCallback = function({ g, h, j }) { | ||
if (onMoment && typeof onMoment === 'function') { | ||
onMoment(g, h, j); | ||
} | ||
} | ||
react_1.useEffect(function () { | ||
@@ -68,3 +73,3 @@ if (!(window === null || window === void 0 ? void 0 : window[scriptFlag]) && window.google && script === 'ready') { | ||
if ((window === null || window === void 0 ? void 0 : window[scriptFlag]) && script === 'ready' && !disabled) { | ||
window.google.accounts.id.prompt(); | ||
window.google.accounts.id.prompt(momentCallback); | ||
} | ||
@@ -71,0 +76,0 @@ }, [script, window === null || window === void 0 ? void 0 : window[scriptFlag], disabled]); |
@@ -16,2 +16,4 @@ import { ReactElement } from 'react'; | ||
onSuccess?: (response: IGoogleEndPointResponse) => void; | ||
onMoment?: (eventType?: string, value?: boolean | string, message?: string) => void; | ||
decodeToken?: boolean | ||
} | ||
@@ -18,0 +20,0 @@ export interface IGoogleOneTapLoginProps { |
import { IUseGoogleOneTapLogin } from './types'; | ||
export declare function useGoogleOneTapLogin({ onError, disabled, onSuccess, googleAccountConfigs, }: IUseGoogleOneTapLogin): null; | ||
export declare function useGoogleOneTapLogin({ onError, disabled, onSuccess, onMoment, googleAccountConfigs, decodeToken }: IUseGoogleOneTapLogin): null; |
{ | ||
"name": "sheetgo-react-google-one-tap-sign-in", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Sheetgo forking of React wrapper for google one tap authentication", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
51325
528