@passflow/core 0.33.0 → 0.35.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 CHANGED
@@ -877,7 +877,8 @@ const refreshToken = async () => {
877
877
  }
878
878
  };
879
879
 
880
- // Set tokens manually
880
+ // Set tokens manually. They replace the stored session: pass every token you want to keep
881
+ // (read the current ones with getTokens()).
881
882
  const setTokens = async (tokens) => {
882
883
  try {
883
884
  await passflow.setTokens({
@@ -1237,7 +1238,7 @@ Configuration options:
1237
1238
  | `getTokensCache()` | Get current tokens |
1238
1239
  | `getParsedTokenCache()` | Get parsed tokens |
1239
1240
  | `refreshToken()` | Refresh the access token |
1240
- | `setTokens(tokens)` | Set tokens manually |
1241
+ | `setTokens(tokens)` | Replace the stored tokens |
1241
1242
  | `handleTokensRedirect()` | Handle tokens from redirect |
1242
1243
  | `authRedirectUrl(options)` | Generate an auth redirect URL |
1243
1244
  | `authRedirect(options)` | Redirect to hosted sign-in in the app's mode (async, see [Hosted Sign-In](#hosted-sign-in)) |
@@ -0,0 +1 @@
1
+ (function(){let e=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)),t=t=>{let n=new Uint8Array(t),r=``;for(let t of n)r+=e[t];return r};var n=class extends Error{};async function r(e,r,i,a=1/0){let o=globalThis.crypto?.subtle;if(!o)throw Error(`Web Crypto unavailable`);let s=r.toLowerCase(),c=new TextEncoder;for(let r=0;r<=i;r+=256){if(Date.now()>a)throw new n(`Solve timed out`);let l=Math.min(r+256-1,i),u=[];for(let t=r;t<=l;t++)u.push(o.digest(`SHA-256`,c.encode(`${e}:${t}`)));let d=await Promise.all(u);for(let e=0;e<d.length;e++)if(t(d[e])===s)return r+e}return null}async function i(e){try{return{number:await r(e.salt,e.challenge,e.max)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}}let a=self;a.onmessage=e=>{i(e.data).then(e=>a.postMessage(e))}})();