PageSourceSearch

https://simpleflightplanner.com/assets/AutoRouterCallback-fGvSnI-G.js

js simpleflightplanner.com collected 2026-10-09 22:03:57 UTC 2,148 bytes, 6 lines download raw bytes

1import{q as h,aX as p,b9 as k,r as i,an as f,bA as _,j as t,b,aN as j,B as w}from"./index-FGpVx5RF.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const y=h("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function C(){const[a]=p(),c=k(),[o,r]=i.useState("working"),[x,s]=i.useState("Completing AutoRouter sign-in…");return i.useEffect(()=>{const u=a.get("code"),l=a.get("state"),m=a.get("error");if(m){r("error"),s(`AutoRouter returned an error: ${m}`);return}if(!u){r("error"),s("Missing authorization code.");return}const d=sessionStorage.getItem("autorouter_oauth_state");if(!l||l!==d){r("error"),s("State mismatch — possible CSRF. Please try again.");return}sessionStorage.removeItem("autorouter_oauth_state");const g=`${window.location.origin}/auth/autorouter/callback`;(async()=>{const{data:e,error:n}=await f.functions.invoke("autorouter-oauth-exchange",{body:{action:"exchange",code:u,redirect_uri:g}});if(n||!(e!=null&&e.access_token)){r("error"),s((e==null?void 0:e.error)||(n==null?void 0:n.message)||"Token exchange failed.");return}_({access_token:e.access_token,refresh_token:e.refresh_token,expires_at:Date.now()+(e.expires_in??3600)*1e3,user_email:e.user_email}),r("ok"),s("AutoRouter connected. Redirecting…"),setTimeout(()=>c("/planner"),1200)})()},[a,c]),t.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:t.jsxs("div",{className:"max-w-md w-full border rounded-lg p-6 text-center space-y-3",children:[o==="working"&&t.jsx(b,{className:"h-8 w-8 mx-auto animate-spin text-primary"}),o==="ok"&&t.jsx(j,{className:"h-8 w-8 mx-auto text-green-500"}),o==="error"&&t.jsx(y,{className:"h-8 w-8 mx-auto text-destructive"}),t.jsx("h1",{className:"text-lg font-semibold",children:"AutoRouter"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:x}),o==="error"&&t.jsx(w,{variant:"outline",onClick:()=>c("/planner"),children:"Back to planner"})]})})}export{C as default};

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.