"use strict";(globalThis.webpackChunk_affine_web=globalThis.webpackChunk_affine_web||[]).push([[5764],{55764:(e,t,n)=>{n.r(t),n.d(t,{Component:()=>r,loader:()=>i});var a=n(15010);let i=async({request:e})=>{let t=new URL(e.url).searchParams,n=t.get("email"),i=t.get("token"),r=t.get("redirect_uri");if(!n||!i)return(0,a.V2)("/404");let o=await fetch("/api/auth/magic-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:n,token:i})});if(!o.ok){let e;try{let{message:t}=await o.json();e=t}catch(t){e="failed to verify sign-in token"}return(0,a.V2)(`/signIn?error=${encodeURIComponent(e)}`)}return location.href=r||"/",null},r=()=>null}}]); //# sourceMappingURL=chunk.5764.7a40e236.js.map