web-auth-library
Advanced tools
Comparing version
/* SPDX-FileCopyrightText: 2022-present Kriasoft */ | ||
/* SPDX-License-Identifier: MIT */ | ||
export const canUseDefaultCache = typeof caches?.default?.put === "function"; | ||
export const canUseDefaultCache = typeof self.caches?.default?.put === "function"; |
@@ -35,5 +35,5 @@ import { type Credentials } from "./credentials.js"; | ||
}; | ||
waitUntil?: <T = unknown>(promise: Promise<T>) => void; | ||
waitUntil?: (promise: Promise<any>) => void; | ||
cache?: Map<string, any>; | ||
}; | ||
export {}; |
@@ -90,3 +90,7 @@ /* SPDX-FileCopyrightText: 2022-present Kriasoft */ | ||
body.append("assertion", jwt); | ||
res = await fetch(tokenUrl, { method: "POST", body }); | ||
res = await fetch(tokenUrl, { | ||
method: "POST", | ||
headers: { "Content-Type": "application/x-www-form-urlencoded" }, | ||
body, | ||
}); | ||
if (!res.ok) { | ||
@@ -93,0 +97,0 @@ const error = await res |
@@ -29,3 +29,3 @@ import { KeyLike } from "jose"; | ||
certificateURL?: string; | ||
waitUntil?: <T = unknown>(promise: Promise<T>) => void; | ||
waitUntil?: (promise: Promise<any>) => void; | ||
}): Promise<KeyLike>; | ||
@@ -32,0 +32,0 @@ /** |
@@ -99,3 +99,3 @@ import { Credentials } from "./credentials.js"; | ||
}; | ||
waitUntil?: <T = unknown>(promise: Promise<T>) => void; | ||
waitUntil?: (promise: Promise<any>) => void; | ||
}): Promise<UserToken>; | ||
@@ -102,0 +102,0 @@ type VerifyCustomTokenResponse = { |
{ | ||
"name": "web-auth-library", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"packageManager": "yarn@4.0.0-rc.39", | ||
@@ -29,3 +29,3 @@ "description": "Authentication library for the browser environment using Web Crypto API", | ||
], | ||
"repository": "kriasoft/web-auth-library", | ||
"repository": "github:kriasoft/web-auth-library", | ||
"keywords": [ | ||
@@ -32,0 +32,0 @@ "auth", |
@@ -135,2 +135,12 @@ # Web Auth Library | ||
In order to unit test this library locally you will need [Node.js](https://nodejs.org/) v18+ with [corepack enabled](https://nodejs.org/api/corepack.html), a Google Cloud [service account key](https://cloud.google.com/iam/docs/keys-create-delete) ([here](https://console.cloud.google.com/iam-admin/serviceaccounts)) and Firebase API Key ([here](https://console.cloud.google.com/apis/credentials)) that you can save into the [`test/test.override.env`](./test/test.env) file, for example: | ||
``` | ||
GOOGLE_CLOUD_PROJECT=example | ||
GOOGLE_CLOUD_CREDENTIALS={"type":"service_account","project_id":"example",...} | ||
FIREBASE_API_KEY=AIzaSyAZEmdfRWvEYgZpwm6EBLkYJf6ySIMF3Hy | ||
``` | ||
Then run unit tests via `yarn test [--watch]`. | ||
## License | ||
@@ -137,0 +147,0 @@ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
49440
1.68%1111
0.36%154
6.94%