@supabase/auth-js 2.72.0 → 2.72.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -3
- package/dist/main/GoTrueAdminApi.js.map +1 -1
- package/dist/main/GoTrueClient.d.ts +7 -1
- package/dist/main/GoTrueClient.d.ts.map +1 -1
- package/dist/main/GoTrueClient.js +132 -51
- package/dist/main/GoTrueClient.js.map +1 -1
- package/dist/main/lib/base64url.d.ts +3 -2
- package/dist/main/lib/base64url.d.ts.map +1 -1
- package/dist/main/lib/base64url.js +10 -11
- package/dist/main/lib/base64url.js.map +1 -1
- package/dist/main/lib/error-codes.d.ts +1 -1
- package/dist/main/lib/error-codes.d.ts.map +1 -1
- package/dist/main/lib/errors.d.ts +1 -1
- package/dist/main/lib/errors.d.ts.map +1 -1
- package/dist/main/lib/errors.js +7 -7
- package/dist/main/lib/errors.js.map +1 -1
- package/dist/main/lib/fetch.d.ts +2 -2
- package/dist/main/lib/fetch.d.ts.map +1 -1
- package/dist/main/lib/fetch.js +8 -9
- package/dist/main/lib/fetch.js.map +1 -1
- package/dist/main/lib/helpers.d.ts +3 -2
- package/dist/main/lib/helpers.d.ts.map +1 -1
- package/dist/main/lib/helpers.js +34 -24
- package/dist/main/lib/helpers.js.map +1 -1
- package/dist/main/lib/local-storage.js +1 -2
- package/dist/main/lib/local-storage.js.map +1 -1
- package/dist/main/lib/locks.js +3 -3
- package/dist/main/lib/locks.js.map +1 -1
- package/dist/main/lib/polyfills.js +1 -2
- package/dist/main/lib/polyfills.js.map +1 -1
- package/dist/main/lib/types.d.ts +373 -358
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/lib/types.js +17 -0
- package/dist/main/lib/types.js.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.d.ts.map +1 -1
- package/dist/main/lib/version.js +7 -1
- package/dist/main/lib/version.js.map +1 -1
- package/dist/main/lib/web3/ethereum.d.ts +9 -9
- package/dist/main/lib/web3/ethereum.d.ts.map +1 -1
- package/dist/main/lib/web3/ethereum.js +4 -5
- package/dist/main/lib/web3/ethereum.js.map +1 -1
- package/dist/main/lib/web3/solana.d.ts +4 -4
- package/dist/main/lib/web3/solana.d.ts.map +1 -1
- package/dist/main/lib/webauthn.d.ts +274 -0
- package/dist/main/lib/webauthn.d.ts.map +1 -0
- package/dist/main/lib/webauthn.dom.d.ts +583 -0
- package/dist/main/lib/webauthn.dom.d.ts.map +1 -0
- package/dist/main/lib/webauthn.dom.js +4 -0
- package/dist/main/lib/webauthn.dom.js.map +1 -0
- package/dist/main/lib/webauthn.errors.d.ts +80 -0
- package/dist/main/lib/webauthn.errors.d.ts.map +1 -0
- package/dist/main/lib/webauthn.errors.js +265 -0
- package/dist/main/lib/webauthn.errors.js.map +1 -0
- package/dist/main/lib/webauthn.js +702 -0
- package/dist/main/lib/webauthn.js.map +1 -0
- package/dist/module/GoTrueAdminApi.js.map +1 -1
- package/dist/module/GoTrueClient.d.ts +7 -1
- package/dist/module/GoTrueClient.d.ts.map +1 -1
- package/dist/module/GoTrueClient.js +139 -57
- package/dist/module/GoTrueClient.js.map +1 -1
- package/dist/module/lib/base64url.d.ts +3 -2
- package/dist/module/lib/base64url.d.ts.map +1 -1
- package/dist/module/lib/base64url.js.map +1 -1
- package/dist/module/lib/error-codes.d.ts +1 -1
- package/dist/module/lib/error-codes.d.ts.map +1 -1
- package/dist/module/lib/errors.d.ts +1 -1
- package/dist/module/lib/errors.d.ts.map +1 -1
- package/dist/module/lib/errors.js.map +1 -1
- package/dist/module/lib/fetch.d.ts +2 -2
- package/dist/module/lib/fetch.d.ts.map +1 -1
- package/dist/module/lib/fetch.js.map +1 -1
- package/dist/module/lib/helpers.d.ts +3 -2
- package/dist/module/lib/helpers.d.ts.map +1 -1
- package/dist/module/lib/helpers.js.map +1 -1
- package/dist/module/lib/locks.js.map +1 -1
- package/dist/module/lib/polyfills.js.map +1 -1
- package/dist/module/lib/types.d.ts +373 -358
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/lib/types.js +17 -0
- package/dist/module/lib/types.js.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.d.ts.map +1 -1
- package/dist/module/lib/version.js +7 -1
- package/dist/module/lib/version.js.map +1 -1
- package/dist/module/lib/web3/ethereum.d.ts +9 -9
- package/dist/module/lib/web3/ethereum.d.ts.map +1 -1
- package/dist/module/lib/web3/ethereum.js.map +1 -1
- package/dist/module/lib/web3/solana.d.ts +4 -4
- package/dist/module/lib/web3/solana.d.ts.map +1 -1
- package/dist/module/lib/webauthn.d.ts +274 -0
- package/dist/module/lib/webauthn.d.ts.map +1 -0
- package/dist/module/lib/webauthn.dom.d.ts +583 -0
- package/dist/module/lib/webauthn.dom.d.ts.map +1 -0
- package/dist/module/lib/webauthn.dom.js +3 -0
- package/dist/module/lib/webauthn.dom.js.map +1 -0
- package/dist/module/lib/webauthn.errors.d.ts +80 -0
- package/dist/module/lib/webauthn.errors.d.ts.map +1 -0
- package/dist/module/lib/webauthn.errors.js +257 -0
- package/dist/module/lib/webauthn.errors.js.map +1 -0
- package/dist/module/lib/webauthn.js +685 -0
- package/dist/module/lib/webauthn.js.map +1 -0
- package/package.json +13 -33
- package/src/GoTrueClient.ts +279 -81
- package/src/lib/base64url.ts +4 -2
- package/src/lib/errors.ts +1 -1
- package/src/lib/helpers.ts +2 -1
- package/src/lib/types.ts +466 -354
- package/src/lib/version.ts +7 -1
- package/src/lib/webauthn.dom.ts +636 -0
- package/src/lib/webauthn.errors.ts +317 -0
- package/src/lib/webauthn.ts +929 -0
package/src/lib/base64url.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* that repo!
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { Uint8Array_ } from './webauthn.dom'
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* An array of characters that encode 6 bits into a Base64-URL alphabet
|
|
9
11
|
* character.
|
|
@@ -268,7 +270,7 @@ export function stringFromUTF8(
|
|
|
268
270
|
* Helper functions to convert different types of strings to Uint8Array
|
|
269
271
|
*/
|
|
270
272
|
|
|
271
|
-
export function base64UrlToUint8Array(str: string):
|
|
273
|
+
export function base64UrlToUint8Array(str: string): Uint8Array_ {
|
|
272
274
|
const result: number[] = []
|
|
273
275
|
const state = { queue: 0, queuedBits: 0 }
|
|
274
276
|
|
|
@@ -283,7 +285,7 @@ export function base64UrlToUint8Array(str: string): Uint8Array {
|
|
|
283
285
|
return new Uint8Array(result)
|
|
284
286
|
}
|
|
285
287
|
|
|
286
|
-
export function stringToUint8Array(str: string):
|
|
288
|
+
export function stringToUint8Array(str: string): Uint8Array_ {
|
|
287
289
|
const result: number[] = []
|
|
288
290
|
stringToUTF8(str, (byte: number) => result.push(byte))
|
|
289
291
|
return new Uint8Array(result)
|
package/src/lib/errors.ts
CHANGED
|
@@ -147,7 +147,7 @@ export class AuthWeakPasswordError extends CustomAuthError {
|
|
|
147
147
|
*/
|
|
148
148
|
reasons: WeakPasswordReasons[]
|
|
149
149
|
|
|
150
|
-
constructor(message: string, status: number, reasons:
|
|
150
|
+
constructor(message: string, status: number, reasons: WeakPasswordReasons[]) {
|
|
151
151
|
super(message, 'AuthWeakPasswordError', status, 'weak_password')
|
|
152
152
|
|
|
153
153
|
this.reasons = reasons
|
package/src/lib/helpers.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { API_VERSION_HEADER_NAME, BASE64URL_REGEX } from './constants'
|
|
|
2
2
|
import { AuthInvalidJwtError } from './errors'
|
|
3
3
|
import { base64UrlToUint8Array, stringFromBase64URL } from './base64url'
|
|
4
4
|
import { JwtHeader, JwtPayload, SupportedStorage, User } from './types'
|
|
5
|
+
import { Uint8Array_ } from './webauthn.dom'
|
|
5
6
|
|
|
6
7
|
export function expiresAt(expiresIn: number) {
|
|
7
8
|
const timeNow = Math.round(Date.now() / 1000)
|
|
@@ -171,7 +172,7 @@ export class Deferred<T = any> {
|
|
|
171
172
|
export function decodeJWT(token: string): {
|
|
172
173
|
header: JwtHeader
|
|
173
174
|
payload: JwtPayload
|
|
174
|
-
signature:
|
|
175
|
+
signature: Uint8Array_
|
|
175
176
|
raw: {
|
|
176
177
|
header: string
|
|
177
178
|
payload: string
|