PageSourceSearch

https://myechoboard.com/assets/nativeAuthBridge-NeIbzRg5.js

js myechoboard.com collected 2026-09-24 13:47:36 UTC 3,520 bytes, 1 lines download raw bytes

1import{C as e,B as t}from"./vendor-capacitor-8exTJy5k.js";import{supabase as i}from"./supabase-client-_h80EYw_.js";import{r as o}from"./authEmailCode-DGb-Vfkf.js";import{a as s,e as n}from"./app-BhliLHoU.js";import{d as a,v as r,r as u}from"./useUserSettings-COPNty3J.js";import{b as d,c as l}from"./fullApp-Ij3xCJOB.js";const c=()=>{var e,t;return"undefined"!=typeof window?null==(t=null==(e=window.webkit)?void 0:e.messageHandlers)?void 0:t.echoNativeAuth:void 0},m=e=>{const t=c();if(t)try{t.postMessage(e)}catch(i){}},_=async n=>{const a="string"==typeof n?JSON.parse(n):n,u=null==a?void 0:a.type;try{if("signIn"===u)return await o({email:String(a.email||"").trim(),intent:"login"}),void m({type:"command-result",success:!0,requiresCode:!0,message:"Check your email for your Echo sign-in code."});if("signUp"===u)return await o({email:String(a.email||"").trim(),fullName:String(a.fullName||"").trim(),intent:"signup"}),void m({type:"command-result",success:!0,requiresCode:!0,message:"Check your email for your Echo sign-in code."});if("verifyEmailCode"===u){const e=await r({verify:()=>i.auth.verifyOtp({email:String(a.email||"").trim().toLowerCase(),token:String(a.code||"").trim(),type:"email"}),getSession:()=>i.auth.getSession()});if(!e.authenticated)throw new Error("message"in e?e.message:"Email verification did not establish a session.");return void m({type:"command-result",success:!0})}if("social"===u){a.provider;const o="apple"===a.provider?"apple":"google";return s("echo_oauth_provider",o),s("echo_oauth_intent","login"),await(async o=>{const s=e.isNativePlatform()?d(o):null,{data:n,error:a}=await i.auth.signInWithOAuth({provider:o,options:{redirectTo:s??`${window.location.origin}/`,skipBrowserRedirect:e.isNativePlatform()}});if(a)throw e.isNativePlatform()&&l(),a;e.isNativePlatform()&&(null==n?void 0:n.url)&&await t.open({url:n.url,windowName:"_self"})})(o),void m({type:"command-result",success:!0,deferred:!0,message:"Continue in Echo to finish sign-in."})}m({type:"command-result",success:!1,message:"Unknown native auth command."})}catch(c){m({type:"command-result",success:!1,message:c instanceof Error?c.message:"Authentication failed."})}},f=()=>{if("undefined"==typeof window||!e.isNativePlatform()||"ios"!==e.getPlatform()||!c()||window.__ECHO_NATIVE_AUTH_BRIDGE_INSTALLED__)return!1;window.__ECHO_NATIVE_AUTH_BRIDGE_INSTALLED__=!0,window.__ECHO_NATIVE_AUTH_RUN__=e=>(_(e),!0);const t=Array.isArray(window.__ECHO_NATIVE_AUTH_QUEUE__)?[...window.__ECHO_NATIVE_AUTH_QUEUE__]:[];window.__ECHO_NATIVE_AUTH_QUEUE__=[],t.length>0&&t.forEach(e=>{_(e)});let o=!1;const s=async()=>{const e=await u({getSession:()=>i.auth.getSession(),refreshSession:()=>i.auth.refreshSession(),hasPersistedSession:n});if("indeterminate"===e.status)return e.error instanceof Error&&e.error.message,void window.setTimeout(()=>{s()},1e3);o=!0;const t="authenticated"===e.status;m({type:"session-state",event:"INITIAL_SESSION",authenticated:t})};return s().catch(e=>{e instanceof Error&&e.message,window.setTimeout(()=>{s()},1e3)}),i.auth.onAuthStateChange((e,t)=>{Boolean(null==t?void 0:t.user),a({event:e,hasSession:Boolean(null==t?void 0:t.user),reconciliationComplete:o})||(((null==t?void 0:t.user)||"SIGNED_OUT"===e)&&(o=!0),m({type:"session-state",event:e,authenticated:Boolean(null==t?void 0:t.user)}))}),m({type:"bridge-ready"}),!0};if(!f()&&"undefined"!=typeof window&&e.isNativePlatform()&&"ios"===e.getPlatform()){let e=40;const t=()=>{f()||e<=0||(e-=1,window.setTimeout(t,250))};window.setTimeout(t,0)}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.