🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

to
2.0.1

dist/decodeJWT.d.ts

6

package.json
{
"name": "@assaf/react-one-tap",
"version": "2.0.0",
"version": "2.0.1",
"description": "Google One Tap for React",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/react-one-tap.esm.js",
"types": "dist/index.d.ts",
"scripts": {
"start": "tsdx watch",
"build": "tsdx build && tsc src/server/authenticate.ts --outDir dist/server && cp src/server/authenticate.ts dist/server",
"build": "tsdx build && tsc -p src/server",
"lint": "tsdx lint",

@@ -12,0 +12,0 @@ "prepare": "tsdx build"

@@ -111,3 +111,2 @@ React components for [one-tap sign-in](https://developers.google.com/identity/one-tap/) with your Google account.

} else {
if (response.status === 403) signOut();
const { error } = await response.json();

@@ -136,3 +135,2 @@ throw new Error(error);

} else {
if (response.status === 403) signOut();
const { error } = await response.json();

@@ -162,3 +160,3 @@ throw new Error(error);

```typescript
import { authenticate } from "@assaf/react-one-tap/dist/server";
import authenticate from "@assaf/react-one-tap/dist/server";

@@ -165,0 +163,0 @@ const clientId = process.env.GOOGLE_CLIENT_ID;

@@ -1,2 +0,2 @@

import { Profile } from "./Profile";
import type { Profile } from ".";

@@ -3,0 +3,0 @@ export default function decodeJWT(token: string | null): Profile | undefined {

import * as React from "react";
import { OneTapOptions, Profile } from ".";
import decodeJWT from "./decodeJWT";
import OneTapContext from "./OneTapContext";
import { OneTapOptions } from "./OneTapOptions";
import { Profile } from "./Profile";
import useGoogleAPI from "./useGoogleAPI";

@@ -7,0 +6,0 @@ import useLocalStorage from "./useLocalStorage";

export { default as GoogleOneTap } from "./GoogleOneTap";
export type { OneTapOptions } from "./OneTapOptions";
export type { Profile } from "./Profile";
export type { OneTapContext, OneTapOptions, Profile } from "./types";
export { default as useGoogleOneTap } from "./useGoogleOneTap";
import * as React from "react";
import { Profile } from "./Profile";
import type { OneTapContext } from ".";
declare type OneTapContext = {
// Bearer token authorization header for the API call:
//
// Authorization: Bearer <token>
headers?: { authorization: string };
isSignedIn: boolean;
// JTW token payload provides user name, email address, photo, etc.
profile?: Profile;
// Call this function to sign-out the user from this and all other tabs.
//
// You can also call this if the server responds with 403 (access token revoked).
signOut: () => void;
// This is the OAuth Bearer token.
token: string | null;
};
export default React.createContext<OneTapContext>({

@@ -25,0 +5,0 @@ isSignedIn: false,

@@ -6,6 +6,4 @@ {

"declarationDir": "../../dist/server",
"forceConsistentCasingInFileNames": true,
"outDir": "../../dist/server",
"strict": true,
"typeRoots": ["node_modules/@types"]
"sourceMap": true
},

@@ -12,0 +10,0 @@ "exclude": ["node_modules"],

import * as React from "react";
import type { OneTapOptions } from ".";
import decodeJWT from "./decodeJWT";
import { OneTapOptions } from "./OneTapOptions";

@@ -5,0 +5,0 @@ // https://developers.google.com/identity/gsi/web/reference/js-reference

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet