New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@assaf/react-one-tap

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@assaf/react-one-tap - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

24

dist/GoogleOneTap.js

@@ -50,15 +50,24 @@ "use strict";

token: token,
}), signOut = _c.signOut, withScript = _c.withScript;
React.useEffect(function reauthenticateTimeout() {
}), reauthenticate = _c.reauthenticate, signOut = _c.signOut;
React.useEffect(function signOutWhenTokenExpires() {
if (!profile)
return;
var expiresIn = profile.exp * 1000 - Date.now();
if (expiresIn < 0)
return;
var timeout = setTimeout(signOut, expiresIn);
return function () { return clearTimeout(timeout); };
}, [profile === null || profile === void 0 ? void 0 : profile.exp]);
React.useEffect(function reauthenticateBeforeTokenExpires() {
var _a;
if (!profile)
return;
var expiresIn = profile.exp * 1000 - Date.now();
var leadTime = duration((_a = options.reauthenticate) !== null && _a !== void 0 ? _a : defaultReauthenticate);
if (!leadTime)
return;
var expiresIn = profile.exp * 1000 - Date.now();
var promptIn = expiresIn - duration(leadTime);
if (promptIn < 0)
return;
var timeout = setTimeout(function () { return withScript(function () { return google.accounts.id.prompt(); }); }, promptIn);
var timeout = setTimeout(reauthenticate, promptIn);
return function () { return clearTimeout(timeout); };

@@ -165,2 +174,7 @@ }, [profile === null || profile === void 0 ? void 0 : profile.exp]);

}, [token]);
var reauthenticate = React.useCallback(function () {
return withScript(function () {
google.accounts.id.prompt();
});
}, [token]);
var signOut = React.useCallback(function () {

@@ -176,3 +190,3 @@ return withScript(function () {

}, [token]);
return { signOut: signOut, withScript: withScript };
return { reauthenticate: reauthenticate, signOut: signOut };
}

@@ -179,0 +193,0 @@ function promptToSignIn(options) {

{
"name": "@assaf/react-one-tap",
"version": "1.3.0",
"version": "1.4.0",
"description": "Google One Tap for React",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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