@supabase/gotrue-js
Advanced tools
Comparing version 2.63.0-rc.rc.rc.11 to 2.63.0-rc.rc.rc.rc.11
@@ -47,3 +47,4 @@ import { SupportedStorage } from './types'; | ||
export declare function generatePKCEChallenge(verifier: string): Promise<string>; | ||
export declare function getCodeChallengeAndMethod(storage: SupportedStorage, storageKey: string, isPasswordRecovery?: boolean): Promise<string[]>; | ||
export {}; | ||
//# sourceMappingURL=helpers.d.ts.map |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generatePKCEChallenge = exports.generatePKCEVerifier = exports.retryable = exports.sleep = exports.decodeJWTPayload = exports.Deferred = exports.decodeBase64URL = exports.removeItemAsync = exports.getItemAsync = exports.setItemAsync = exports.looksLikeFetchResponse = exports.resolveFetch = exports.parseParametersFromURL = exports.supportsLocalStorage = exports.isBrowser = exports.uuid = exports.expiresAt = void 0; | ||
exports.getCodeChallengeAndMethod = exports.generatePKCEChallenge = exports.generatePKCEVerifier = exports.retryable = exports.sleep = exports.decodeJWTPayload = exports.Deferred = exports.decodeBase64URL = exports.removeItemAsync = exports.getItemAsync = exports.setItemAsync = exports.looksLikeFetchResponse = exports.resolveFetch = exports.parseParametersFromURL = exports.supportsLocalStorage = exports.isBrowser = exports.uuid = exports.expiresAt = void 0; | ||
function expiresAt(expiresIn) { | ||
@@ -293,2 +293,14 @@ const timeNow = Math.round(Date.now() / 1000); | ||
exports.generatePKCEChallenge = generatePKCEChallenge; | ||
async function getCodeChallengeAndMethod(storage, storageKey, isPasswordRecovery = false) { | ||
const codeVerifier = generatePKCEVerifier(); | ||
let storedCodeVerifier = codeVerifier; | ||
if (isPasswordRecovery) { | ||
storedCodeVerifier += '/PASSWORD_RECOVERY'; | ||
} | ||
await (0, exports.setItemAsync)(storage, `${storageKey}-code-verifier`, storedCodeVerifier); | ||
const codeChallenge = await generatePKCEChallenge(codeVerifier); | ||
const codeChallengeMethod = codeVerifier === codeChallenge ? 'plain' : 's256'; | ||
return [codeChallenge, codeChallengeMethod]; | ||
} | ||
exports.getCodeChallengeAndMethod = getCodeChallengeAndMethod; | ||
//# sourceMappingURL=helpers.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const version = "2.63.0-rc.rc.rc.11"; | ||
export declare const version = "2.63.0-rc.rc.rc.rc.11"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '2.63.0-rc.rc.rc.11'; | ||
exports.version = '2.63.0-rc.rc.rc.rc.11'; | ||
//# sourceMappingURL=version.js.map |
@@ -47,3 +47,4 @@ import { SupportedStorage } from './types'; | ||
export declare function generatePKCEChallenge(verifier: string): Promise<string>; | ||
export declare function getCodeChallengeAndMethod(storage: SupportedStorage, storageKey: string, isPasswordRecovery?: boolean): Promise<string[]>; | ||
export {}; | ||
//# sourceMappingURL=helpers.d.ts.map |
@@ -249,2 +249,13 @@ export function expiresAt(expiresIn) { | ||
} | ||
export async function getCodeChallengeAndMethod(storage, storageKey, isPasswordRecovery = false) { | ||
const codeVerifier = generatePKCEVerifier(); | ||
let storedCodeVerifier = codeVerifier; | ||
if (isPasswordRecovery) { | ||
storedCodeVerifier += '/PASSWORD_RECOVERY'; | ||
} | ||
await setItemAsync(storage, `${storageKey}-code-verifier`, storedCodeVerifier); | ||
const codeChallenge = await generatePKCEChallenge(codeVerifier); | ||
const codeChallengeMethod = codeVerifier === codeChallenge ? 'plain' : 's256'; | ||
return [codeChallenge, codeChallengeMethod]; | ||
} | ||
//# sourceMappingURL=helpers.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const version = "2.63.0-rc.rc.rc.11"; | ||
export declare const version = "2.63.0-rc.rc.rc.rc.11"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export const version = '2.63.0-rc.rc.rc.11'; | ||
export const version = '2.63.0-rc.rc.rc.rc.11'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@supabase/gotrue-js", | ||
"version": "2.63.0-rc.rc.rc.11", | ||
"version": "2.63.0-rc.rc.rc.rc.11", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Official client library for Supabase Auth", |
@@ -307,1 +307,17 @@ import { SupportedStorage } from './types' | ||
} | ||
export async function getCodeChallengeAndMethod( | ||
storage: SupportedStorage, | ||
storageKey: string, | ||
isPasswordRecovery = false | ||
) { | ||
const codeVerifier = generatePKCEVerifier() | ||
let storedCodeVerifier = codeVerifier | ||
if (isPasswordRecovery) { | ||
storedCodeVerifier += '/PASSWORD_RECOVERY' | ||
} | ||
await setItemAsync(storage, `${storageKey}-code-verifier`, storedCodeVerifier) | ||
const codeChallenge = await generatePKCEChallenge(codeVerifier) | ||
const codeChallengeMethod = codeVerifier === codeChallenge ? 'plain' : 's256' | ||
return [codeChallenge, codeChallengeMethod] | ||
} |
@@ -1,1 +0,1 @@ | ||
export const version = '2.63.0-rc.rc.rc.11' | ||
export const version = '2.63.0-rc.rc.rc.rc.11' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
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
Sorry, the diff of this file is too big to display
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
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 too big to display
14011
778968