@seamless-auth/react 0.0.7-beta.4 → 0.0.7
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/dist/MagicLogin.d.ts +2 -0
- package/dist/VerifyEmailOTP.d.ts +3 -0
- package/dist/VerifyMagicLink.d.ts +3 -0
- package/dist/VerifyPhoneOTP.d.ts +3 -0
- package/dist/components/AuthFallbackOptions.d.ts +9 -0
- package/dist/components/LoadingSpinner.d.ts +3 -0
- package/dist/components/MagicLinkSent.d.ts +3 -0
- package/dist/components/OtpInput.d.ts +8 -0
- package/dist/components/TermsModal.d.ts +7 -0
- package/dist/hooks/useVerifyMagicLink.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/views/EmailRegistration.d.ts +3 -0
- package/dist/views/Login.d.ts +3 -0
- package/dist/views/PassKeyLogin.d.ts +3 -0
- package/dist/views/PassKeyRegistration.d.ts +3 -0
- package/dist/views/PhoneRegistration.d.ts +3 -0
- package/dist/views/VerifyMagicLink.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AuthFallbackOptionsProps {
|
|
3
|
+
identifier: string;
|
|
4
|
+
onMagicLink: () => void;
|
|
5
|
+
onPhoneOtp: () => void;
|
|
6
|
+
onPasskeyRetry: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const AuthFallbackOptions: React.FC<AuthFallbackOptionsProps>;
|
|
9
|
+
export default AuthFallbackOptions;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{createContext as n,useContext as t,useState as i,useEffect as a,useCallback as l,useRef as s}from"react";import{useNavigate as d,Routes as c,Route as _,Navigate as m}from"react-router-dom";import{startAuthentication as u,startRegistration as g,WebAuthnError as p}from"@simplewebauthn/browser";import h,{AsYouType as f,parsePhoneNumberFromString as y}from"libphonenumber-js";const b=n(void 0),v=({value:o,children:r})=>e(b.Provider,{value:o,children:r}),w=()=>{const e=t(b);if(!e)throw new Error("useInternalAuth must be used within InternalAuthProvider");return e},k=e=>{const{authMode:o,authHost:r}=e;return async function(e,n){const t=`${r}${"server"===o?"auth":""}${e.startsWith("/")?e:`/${e}`}`,i={...n,credentials:"include",headers:{"Content-Type":"application/json",...n?.headers}},a=await fetch(t,i);if(a.ok)return a;throw console.warn("Auth fetch failed:",a.status,t),new Error(`Failed to make API call to ${t}`)}},x=()=>e("div",{className:"flex items-center justify-center min-h-screen bg-gray-900",children:e("div",{"data-testid":"loading",className:"w-12 h-12 border-4 border-gray-600 border-t-blue-500 rounded-full animate-spin"})});const P=n(void 0),N=()=>{const e=t(P);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},C=({children:r,apiHost:n,autoDetectPreviousSignin:t=!0,mode:s="web"})=>{const[d,c]=i(null),[_,m]=i([]),[u,g]=i(!1),[p,h]=i(!0),[f,y]=i(null),{hasSignedInBefore:b,markSignedIn:w}=function(e="seamlessauth_seen"){const[o,r]=i(!1);return a(()=>{try{"true"===localStorage.getItem(e)&&r(!0)}catch{}},[e]),{hasSignedInBefore:o,markSignedIn:()=>{try{localStorage.setItem(e,"true"),r(!0)}catch{}}}}(),[N]=i(s),C=k({authMode:N,authHost:n}),S=l(async()=>{if(d)try{await C("/logout",{method:"GET"})}catch{console.error("Error during logout")}finally{g(!1),c(null),y(null)}},[C,d]),T=async()=>{try{const e=await C("users/me",{method:"GET"});if(e.ok){const{user:o,credentials:r}=await e.json();c(o),m(r),g(!0)}else S()}catch{S()}finally{h(!1)}};return a(()=>{T()},[]),a(()=>{d&&u&&w()},[d,u,w]),p?o("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:[e(x,{}),";"]}):e(P.Provider,{value:{user:d,logout:S,deleteUser:async()=>{try{if((await C("/users/delete",{method:"delete"})).ok)return c(null),g(!1),void y(null);throw new Error("Could not delete user.")}catch(e){throw console.error("Something went wrong deleting user:",e),new Error("Could not delete user.")}},isAuthenticated:u,hasRole:e=>d?.roles?.includes(e),apiHost:n,token:f,markSignedIn:w,hasSignedInBefore:!!t&&b,mode:s,credentials:_,updateCredential:async e=>{const o=await C("users/credentials",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({friendlyName:e.friendlyName,id:e.id})});if(o.ok)return o.json();throw new Error("Failed to update credential")},deleteCredential:async e=>{const o=await C("users/credentials",{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(o.ok)return o.json();throw new Error("Failed to update credential")}},children:e(v,{value:{validateToken:T,setLoading:h},children:r})})};function S(e,o){void 0===o&&(o={});var r=o.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===r&&n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}var T="login-module__container___YggDx",O="login-module__card___Ub-Py",M="login-module__heading___neEqb",L="login-module__message___qSejT",I="login-module__inputGroup___P6qgS",E="login-module__label___mx5vu",j="login-module__input___U07lW",A="login-module__helperText___kDQ4-",F="login-module__error___40zxh",z="login-module__button___0kFBs",B="login-module__toggle___1JiG1",G="login-module__underline___gs-RS",V="login-module__phoneRow___oeNtq",q="login-module__select___rRV1O",R="login-module__phoneInput___2MPQC";S(".login-module__container___YggDx{align-items:center;color:#fff;display:flex;justify-content:center}.login-module__card___Ub-Py{background-color:#1f2937;border-radius:.5rem;box-shadow:0 4px 6px rgba(0,0,0,.1);max-width:28rem;padding:2rem;width:100%}.login-module__heading___neEqb{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1.5rem;text-align:center}.login-module__message___qSejT{color:#68d391;text-align:center}.login-module__inputGroup___P6qgS{margin-bottom:1rem}.login-module__label___mx5vu{color:#d1d5db;display:block}.login-module__input___U07lW{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;margin-top:.25rem;padding:.5rem;width:100%}.login-module__input___U07lW:focus{box-shadow:0 0 0 2px #3b82f6;outline:none}.login-module__helperText___kDQ4-{color:#9ca3af;font-size:.75rem;margin-top:.5rem}.login-module__error___40zxh{color:#f87171;font-size:.875rem}.login-module__button___0kFBs{background-color:#2563eb;border-radius:.375rem;color:#fff;cursor:pointer;margin-top:1rem;padding:.5rem;transition:background-color .3s;width:100%}.login-module__button___0kFBs:hover{background-color:#1d4ed8}.login-module__button___0kFBs:disabled{background-color:#9ca3af;cursor:not-allowed}.login-module__toggle___1JiG1{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.login-module__underline___gs-RS{text-decoration:underline}.login-module__phoneRow___oeNtq{display:grid;gap:.5rem;grid-template-columns:1fr 3fr;margin-top:.25rem}.login-module__phoneInput___2MPQC,.login-module__select___rRV1O{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;padding:.5rem;width:100%}@media (max-width:500px){.login-module__phoneRow___oeNtq{grid-template-columns:1fr}}");var U="termsModal-module__overlay___-j6r5",D="termsModal-module__modal___4PxZV",H="termsModal-module__header___B7wxb",K="termsModal-module__title___Sucwt",$="termsModal-module__closeBtn___evIs5",J="termsModal-module__content___5BDhN",W="termsModal-module__link___oPZrU";S(".termsModal-module__overlay___-j6r5{align-items:center;background-color:rgba(0,0,0,.7);display:flex;inset:0;justify-content:center;position:fixed;z-index:999}.termsModal-module__modal___4PxZV{background-color:#1a1a1a;border-radius:8px;box-shadow:0 10px 25px rgba(0,0,0,.4);color:#fff;max-height:80vh;max-width:640px;outline:none;overflow-y:auto;padding:24px;width:100%}.termsModal-module__header___B7wxb{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.termsModal-module__title___Sucwt{color:#60a5fa;font-size:1.25rem;font-weight:700}.termsModal-module__closeBtn___evIs5{background:none;border:none;color:#ccc;cursor:pointer;font-size:1.75rem}.termsModal-module__closeBtn___evIs5:hover{color:#fff}.termsModal-module__content___5BDhN{color:#d1d5db;font-size:.9rem;line-height:1.6}.termsModal-module__link___oPZrU{color:#60a5fa;text-decoration:underline}.termsModal-module__link___oPZrU:hover{text-decoration:none}");const Z=({isOpen:r,onClose:n})=>{const t=s(null);return a(()=>{const e=e=>{"Escape"===e.key&&n()};return r&&(document.addEventListener("keydown",e),t.current?.focus()),()=>{document.removeEventListener("keydown",e)}},[r,n]),r?e("div",{className:U,role:"dialog","aria-modal":"true","aria-labelledby":"terms-title",children:o("div",{className:D,tabIndex:-1,ref:t,children:[o("div",{className:H,children:[e("h2",{id:"terms-title",className:K,children:"SMS Terms & Conditions"}),e("button",{onClick:n,className:$,children:"×"})]}),o("div",{className:J,children:[o("p",{children:[e("strong",{children:"Effective Date:"})," June 01, 2025"]}),e("p",{children:"By providing your phone number to SeamlessAuth, a Fells Code LLC product, you agree to receive SMS messages for identity verification, authentication, and account security."}),o("p",{children:[e("strong",{children:"1. Purpose:"})," SMS is used only for account security (OTP, MFA). No marketing messages."]}),o("p",{children:[e("strong",{children:"2. Frequency:"})," Based on login and account activity."]}),o("p",{children:[e("strong",{children:"3. Opt-Out:"})," Contact support@seamlessauth.com to opt out."]}),o("p",{children:[e("strong",{children:"4. Fees:"})," Message and data rates may apply."]}),o("p",{children:[e("strong",{children:"5. Supported Carriers:"})," Most major providers supported, delivery not guaranteed."]}),o("p",{children:[e("strong",{children:"6. Privacy:"})," Your phone number is not shared or sold. See our Privacy Policy."]}),o("p",{children:[e("strong",{children:"7. Changes:"})," Terms may be updated with notice on this page."]}),o("p",{children:["Questions? Email us at"," ",e("a",{className:W,href:"mailto:support@seamlessauth.com",children:"support@seamlessauth.com"}),"."]})]})]})}):null},Q=[{code:"US",name:"United States",dialCode:"+1",flag:"🇺🇸"},{code:"CA",name:"Canada",dialCode:"+1",flag:"🇨🇦"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"🇬🇧"},{code:"IN",name:"India",dialCode:"+91",flag:"🇮🇳"},{code:"AU",name:"Australia",dialCode:"+61",flag:"🇦🇺"}];function X({phone:r,setPhone:n,phoneError:t,setPhoneError:l}){const[s,d]=i(!1),[c,_]=i(Q[0]);a(()=>{const e=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().locale||"en-US",o=e.split("-")[1]?.toUpperCase()||"US";return Q.find(e=>e.code===o)||Q[0]}catch{return Q[0]}}();_(e)},[]);return o("div",{className:I,children:[e("label",{id:"phone",className:E,children:"Phone Number"}),o("div",{className:V,children:[e("select",{value:c.code,onChange:e=>{const o=Q.find(o=>o.code===e.target.value);if(o){_(o);const e=r.replace(/^\+\d+/,""),t=(new f).input(o.dialCode+e);n(t)}},className:q,children:Q.map(e=>o("option",{value:e.code,children:[e.flag," (",e.dialCode,")"]},e.code))}),e("input",{"aria-labelledby":"phone",type:"tel",value:r,onChange:e=>{const o=e.target.value,r=o.startsWith(c.dialCode)?o:c.dialCode+o,i=(new f).input(r);n(i),t&&l("")},onBlur:()=>{if(r){const e=y(r),o=e?.isValid();l(o?"":"Please enter a valid phone number.")}},autoComplete:"off",placeholder:"(555) 123-4567",className:R})]}),o("p",{className:A,children:["By signing up, you agree to our"," ",e("button",{onClick:()=>d(!0),className:G,children:"SMS Terms & Conditions"}),"."]}),t&&e("p",{className:F,children:t}),e(Z,{isOpen:s,onClose:()=>d(!1)})]})}const Y=e=>{if("string"!=typeof e)return!1;const o=e.trim();if(o.length<3||o.length>320)return!1;const r=o.split("@");if(2!==r.length)return!1;const[n,t]=r;return!(!/^[A-Za-z0-9._%+-]+$/.test(n)||n.startsWith(".")||n.endsWith(".")||n.includes(".."))&&!(!/^[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(t)||t.startsWith("-")||t.endsWith("-")||t.startsWith(".")||t.endsWith(".")||t.includes(".."))},ee=e=>{const o=h(e);return o?.isValid()||!1};async function oe(){if(window.PublicKeyCredential&&"function"==typeof window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable)try{return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}catch(e){return console.error("Error checking passkey support:",e),!1}return!1}const re=()=>{const n=d(),{apiHost:t,hasSignedInBefore:l,mode:s}=N(),{validateToken:c}=w(),[_,m]=i(""),[g,p]=i(""),[h,f]=i("register"),[y,b]=i(""),[v,x]=i(""),[P,C]=i(""),[S,G]=i(""),[V,q]=i(""),[R,U]=i(!1),D=k({authMode:s,authHost:t});a(()=>{!async function(){const e=await oe();U(e)}(),l&&f("login")},[l]);const H=async()=>{x("");try{if(!(await D("/login",{method:"POST",body:JSON.stringify({identifier:_,passkeyAvailable:R})})).ok)return void x("Failed to send login link. Please try again.");await(async()=>{try{const e=await D("/webAuthn/login/start",{method:"POST"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),r=await u({optionsJSON:o}),t=await D("/webAuthn/login/finish",{method:"POST",body:JSON.stringify({assertionResponse:r})});t.ok||console.error("Failed to verify passkey");const i=await t.json();if("Success"===i.message)return i.mfaLogin?void n("/mfaLogin"):(await c(),void n("/"));console.error("Passkey login failed:",i.message)}catch(e){console.error("Passkey login error:",e)}})()}catch(e){console.error("Unexpected login error",e),x("An unexpected error occured. Try again. If the problem persists, try resetting your password")}};return e("div",{className:T,children:o("div",{className:O,children:[e("h2",{className:M,children:"login"===h?"Sign In":"Create Account"}),R?e(r,{children:o("form",{onSubmit:async e=>{e.preventDefault(),"login"===h&&H(),"register"===h&&(async()=>{x("");try{const e=await D("/registration/register",{method:"POST",body:JSON.stringify({email:g,phone:y})});if(!e.ok)return void x("Failed to register. Please try again.");"Success"===(await e.json()).message&&n("/verifyOTP"),x("An unexpected error occured. Try again. If the problem persists, try resetting your password")}catch(e){console.error("Unexpected login error",e),x("An unexpected error occured. Try again. If the problem persists, try resetting your password")}})()},children:["login"===h&&o("div",{className:I,children:[e("label",{htmlFor:"identifier",className:E,children:"Email Address / Phone Number"}),e("input",{id:"identifier",type:"text",value:_,onChange:e=>{const o=e.target.value;m(o)},autoComplete:"off",placeholder:"Email or Phone Number",className:j,onBlur:()=>{if(_){const e=Y(_)||ee(_);q(e?"":"Please enter a valid email or phone number")}},required:!0}),e("p",{className:A,children:"Phone numbers must include a country code e.g. +1"}),V&&e("p",{className:F,children:V})]}),"register"===h&&o(r,{children:[o("div",{className:I,children:[e("label",{htmlFor:"email",className:E,children:"Email Address"}),e("input",{id:"email",type:"email",value:g,onChange:e=>{const o=e.target.value;p(o)},autoComplete:"off",className:j,onBlur:()=>{if(g){const e=Y(g);G(e?"":"Please enter a valid email")}},required:!0}),S&&e("p",{className:F,children:S})]}),e(X,{phone:y,setPhone:b,phoneError:P,setPhoneError:C})]}),e("button",{type:"submit",className:z,disabled:!("login"===h&&_?Y(_)||ee(_):Y(g)&&ee(y)),children:"login"===h?"Login":"Register"}),v&&e("p",{className:F,children:v}),e("button",{type:"button",onClick:()=>f("login"===h?"register":"login"),className:B,children:"login"===h?"Don't have an account? Create one":"Already have an account? Sign in"})]})}):e("p",{className:L,children:"❌ This device doesn't support passkey login. You must provide or register a passkey."})]})})};var ne="mfaLogin-module__container___CDMP9",te="mfaLogin-module__card___kWS58",ie="mfaLogin-module__title___dZABE",ae="mfaLogin-module__msg___2lh2D",le="mfaLogin-module__buttonGroup___3Corm",se="mfaLogin-module__button___4X2WF",de="mfaLogin-module__selected___lkiW-",ce="mfaLogin-module__codeLabel___iC4bk",_e="mfaLogin-module__countdown___rgtkd",me="mfaLogin-module__input___JP-RF",ue="mfaLogin-module__submit___n4-FT",ge="mfaLogin-module__error___SqfpH";S(".mfaLogin-module__container___CDMP9{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.mfaLogin-module__card___kWS58{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);display:flex;flex-direction:column;gap:1.5rem;max-width:400px;padding:1.5rem;width:100%}.mfaLogin-module__title___dZABE{color:#fff;font-size:1.5rem;font-weight:600;text-align:center}.mfaLogin-module__msg___2lh2D{color:#4ade80;text-align:center}.mfaLogin-module__buttonGroup___3Corm{display:flex;flex-direction:column;gap:1rem}.mfaLogin-module__button___4X2WF{background-color:#374151;border:1px solid #4b5563;border-radius:.5rem;color:#fff;font-weight:500;padding:.75rem 1rem;text-align:left;transition:background-color .2s}.mfaLogin-module__button___4X2WF:hover{background-color:#4b5563}.mfaLogin-module__selected___lkiW-{background-color:#2563eb;border-color:#3b82f6}.mfaLogin-module__codeLabel___iC4bk{display:block;font-size:.875rem;font-weight:500;margin-bottom:.25rem}.mfaLogin-module__countdown___rgtkd{color:#facc15;font-size:.875rem}.mfaLogin-module__input___JP-RF{background-color:#374151;border:1px solid #4b5563;border-radius:.5rem;color:#fff;font-family:monospace;font-size:1.25rem;letter-spacing:.2em;padding:.75rem 1rem;width:100%}.mfaLogin-module__input___JP-RF:focus{border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f6;outline:none}.mfaLogin-module__submit___n4-FT{background-color:#2563eb;border:1px solid #3b82f6;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s}.mfaLogin-module__submit___n4-FT:disabled{background-color:#9ca3af;cursor:not-allowed}.mfaLogin-module__error___SqfpH{color:#f87171;margin-bottom:.5rem;text-align:center}@media (max-width:480px){.mfaLogin-module__card___kWS58{padding:1rem}.mfaLogin-module__input___JP-RF,.mfaLogin-module__submit___n4-FT{font-size:1rem}}");const pe=()=>{const{apiHost:n,mode:t}=N(),{validateToken:l}=w(),s=d(),[c,_]=i(""),[m,u]=i(""),[g,p]=i(!1),[h,f]=i(""),[y,b]=i(300),[v,x]=i(null),P=k({authMode:t,authHost:n}),C=async()=>{const e="phone"===v?"otp/verify-login-phone-otp":"otp/verify-login-email-otp";try{if(!(await P(`/${e}`,{method:"POST",body:JSON.stringify({verificationToken:c})})).ok)return void u("Verification failed.");await l(),s("/")}catch(e){console.error("Error verifying OTP",e),u("Verification failed.")}},S=async e=>{u("");const o="phone"===e?"otp/generate-login-phone-otp":"otp/generate-login-email-otp";try{(await P(`/${o}`,{method:"GET"})).ok?f(`Verification ${"phone"===e?"SMS":"email"} has been sent.`):u(`Failed to send ${e} code. If this persists, refresh the page and try again.`)}catch{u(`Failed to send ${e} code. If this persists, refresh the page and try again.`)}};return a(()=>{const e=setInterval(()=>{b(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),e("div",{className:ne,children:o("div",{className:te,children:[e("h2",{className:ie,children:"Multi-factor Authentication"}),h&&e("p",{className:ae,children:h}),o("div",{className:le,children:[o("button",{onClick:()=>{x("phone"),S("phone")},className:`${se} ${"phone"===v?de:""}`,children:["Send code to phone: ",e("span",{className:"font-mono",children:"****1234"})]}),o("button",{onClick:()=>{x("email"),S("email")},className:`${se} ${"email"===v?de:""}`,children:["Send code to email: ",e("span",{className:"font-mono",children:"j***@example.com"})]})]}),v&&o(r,{children:[m&&e("p",{className:ge,children:m}),o("label",{htmlFor:"otp",className:ce,children:["Enter the 6-digit code sent to your ",v,". ",e("br",{}),o("span",{className:_e,children:["Code expires in: ",(T=y,`${Math.floor(T/60).toString().padStart(2,"0")}:${(T%60).toString().padStart(2,"0")}`)]})]}),e("input",{id:"otp",type:"text",maxLength:6,className:me,placeholder:"••••••",onChange:e=>_(e.target.value)}),e("button",{onClick:async e=>{e.preventDefault(),u(""),p(!0);try{await C()}catch{u("Unexpected error occurred.")}finally{p(!1)}},className:ue,disabled:!c||c.length<6||g,children:g?"Verifying...":"Verify"})]})]})});var T};var he="passKeyLogin-module__container___IUKxF",fe="passKeyLogin-module__card___2sKM1",ye="passKeyLogin-module__title___HZxvc",be="passKeyLogin-module__button___FvR4I";S(".passKeyLogin-module__container___IUKxF{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.passKeyLogin-module__card___2sKM1{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);display:flex;flex-direction:column;gap:1.5rem;max-width:400px;padding:2rem;width:100%}.passKeyLogin-module__title___HZxvc{color:#fff;font-size:1.5rem;font-weight:600;text-align:center}.passKeyLogin-module__button___FvR4I{background-color:#2563eb;border:1px solid #3b82f6;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;text-align:center;transition:background-color .2s ease;width:100%}.passKeyLogin-module__button___FvR4I:hover{background-color:#1d4ed8}@media (max-width:480px){.passKeyLogin-module__card___2sKM1{padding:1.25rem}.passKeyLogin-module__button___FvR4I{font-size:1rem}}");const ve=()=>{const r=d(),{apiHost:n,mode:t}=N(),{validateToken:i}=w(),a=k({authMode:t,authHost:n});return e("div",{className:he,children:o("div",{className:fe,children:[e("h2",{className:ye,children:"Login with Passkey"}),e("button",{onClick:async()=>{try{const e=await a("/webAuthn/login/start",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),n=await u({optionsJSON:o}),t=await a("/webAuthn/login/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:n}),credentials:"include"});t.ok||console.error("Failed to verify passkey");const l=await t.json();if("Success"===l.message)return l.mfaLogin&&r("/mfaLogin"),await i(),void r("/");console.error("Passkey login failed")}catch{console.error("Passkey login error")}},className:be,children:"Use Passkey"})]})})};var we="registerPasskey-module__container___jqEh8",ke="registerPasskey-module__card___MJAyC",xe="registerPasskey-module__loading___Q4i1x",Pe="registerPasskey-module__spinner___V1nhd",Ne="registerPasskey-module__supported___ihTih",Ce="registerPasskey-module__title___vn2Qu",Se="registerPasskey-module__description___AWmO-",Te="registerPasskey-module__button___D3b4B",Oe="registerPasskey-module__message___RiOw-",Me="registerPasskey-module__success___HP5aX",Le="registerPasskey-module__error___hGiqE";S(".registerPasskey-module__container___jqEh8{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.registerPasskey-module__card___MJAyC{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);max-width:400px;padding:1.5rem;width:100%}.registerPasskey-module__loading___Q4i1x{align-items:center;background-color:#f9fafb;border-radius:.75rem;box-shadow:0 2px 8px rgba(0,0,0,.1);color:#374151;display:flex;font-weight:500;gap:.75rem;justify-content:center;padding:1.5rem}.registerPasskey-module__spinner___V1nhd{animation:registerPasskey-module__spin___oYcsC 1s linear infinite;border-color:#3b82f6 transparent;border-radius:9999px;border-style:solid;border-width:2px;height:1.5rem;width:1.5rem}@keyframes registerPasskey-module__spin___oYcsC{to{transform:rotate(1turn)}}.registerPasskey-module__supported___ihTih{background-color:#ecfdf5;border-radius:.75rem;box-shadow:0 2px 12px rgba(0,0,0,.1);color:#065f46;padding:1.25rem}.registerPasskey-module__title___vn2Qu{font-size:1.125rem;font-weight:600;margin-bottom:.5rem}.registerPasskey-module__description___AWmO-{margin-bottom:1rem}.registerPasskey-module__button___D3b4B{background-color:#059669;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__button___D3b4B:hover{background-color:#047857}.registerPasskey-module__message___RiOw-{font-size:.875rem;margin-top:1rem}.registerPasskey-module__success___HP5aX{color:#6ee7b7}.registerPasskey-module__error___hGiqE{color:#f87171}");var Ie="deviceNameModal-module__overlay___fmdPd",Ee="deviceNameModal-module__modal___uoEda",je="deviceNameModal-module__description___-HMTA",Ae="deviceNameModal-module__input___4vQMI",Fe="deviceNameModal-module__actions___KXw7b",ze="deviceNameModal-module__primary___9Ozlk",Be="deviceNameModal-module__secondary___HILhc";S(".deviceNameModal-module__overlay___fmdPd{align-items:center;background:rgba(0,0,0,.45);display:flex;inset:0;justify-content:center;position:fixed;z-index:1000}.deviceNameModal-module__modal___uoEda{background:#1f2937;border-radius:12px;box-shadow:0 20px 40px rgba(0,0,0,.15);color:#fff;max-width:420px;padding:24px;width:100%}.deviceNameModal-module__description___-HMTA{color:#fff;font-size:14px;margin-bottom:16px}.deviceNameModal-module__input___4vQMI{border:1px solid #ddd;border-radius:8px;font-size:14px;margin-bottom:20px;padding:10px 12px;width:100%}.deviceNameModal-module__actions___KXw7b{display:flex;gap:10px;justify-content:flex-end}.deviceNameModal-module__primary___9Ozlk{background:#2563eb;border:none;border-radius:8px;color:#fff;cursor:pointer;padding:8px 14px}.deviceNameModal-module__secondary___HILhc{background:transparent;border:1px solid #ccc;border-radius:8px;cursor:pointer;padding:8px 14px}");const Ge=({isOpen:r,onCancel:n,onConfirm:t})=>{const[a,l]=i("");return r?e("div",{className:Ie,children:o("div",{className:Ee,children:[e("h3",{children:"Name This Device"}),e("p",{className:je,children:"Give this passkey a friendly name so you can recognize it later."}),e("input",{type:"text",placeholder:"e.g., MacBook Pro, iPhone, YubiKey",value:a,onChange:e=>l(e.target.value),className:Ae,autoFocus:!0}),o("div",{className:Fe,children:[e("button",{onClick:n,className:Be,children:"Cancel"}),e("button",{onClick:()=>t(a.trim()),disabled:!a.trim(),className:ze,children:"Continue"})]})]})}):null},Ve=()=>{const{apiHost:n,mode:t}=N(),{validateToken:l}=w(),s=d(),[c,_]=i("idle"),[m,u]=i(""),[h,f]=i(!1),[y,b]=i(!1),[v,x]=i(null),P=k({authMode:t,authHost:n});a(()=>{!async function(){const e=await oe();f(e)}()},[]);const C=async(e,o)=>{if(!(await P("/webAuthn/register/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attestationResponse:e,metadata:o}),credentials:"include"})).ok)throw new Error("Verification failed");await l()};return o(r,{children:[e("div",{className:we,children:e("div",{className:ke,children:o("div",h?{className:Ne,children:[e("h2",{className:Ce,children:"Secure Your Account with a Passkey"}),e("p",{className:Se,children:"Your device supports passkeys! Register one to skip passwords forever."}),e("button",{onClick:()=>{const{platform:e,browser:o,deviceInfo:r}=function(){const e=navigator.userAgent.toLowerCase();let o="unknown",r="unknown";return/iphone|ipad|ipod/.test(e)?o="ios":/android/.test(e)?o="android":/mac os/.test(e)?o="mac":/windows/.test(e)?o="windows":/linux/.test(e)&&(o="linux"),/chrome/.test(e)&&(r="chrome"),/safari/.test(e)&&!/chrome/.test(e)&&(r="safari"),/firefox/.test(e)&&(r="firefox"),/edg/.test(e)&&(r="edge"),{platform:o,browser:r,deviceInfo:`${o} • ${r}`}}();x({platform:e,browser:o,deviceInfo:r}),b(!0)},disabled:"loading"===c,className:Te,children:"loading"===c?"Registering...":"Register Passkey"}),m&&e("p",{className:`${Oe} ${"success"===c?Me:Le}`,children:m})]}:{className:xe,children:[e("div",{className:Pe}),e("span",{children:"Checking for Passkey Support..."})]})})}),e(Ge,{isOpen:y,onCancel:()=>{b(!1),x(null)},onConfirm:async e=>{if(!v)return;const{platform:o,browser:r,deviceInfo:n}=v;_("loading");try{const t=await P("/webAuthn/register/start",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!t.ok)throw new Error("Failed to fetch challenge");const i=await t.json();let a;try{a=await g({optionsJSON:i})}catch(e){if(e instanceof p)throw new Error(e.name);throw e}await C(a,{friendlyName:e,platform:o,browser:r,deviceInfo:n}),_("success"),u("Passkey registered successfully."),s("/")}catch(e){console.error(e),_("error"),u("Error registering passkey.")}finally{b(!1),x(null)}}})]})};var qe="verifyOTP-module__container___wgoDE",Re="verifyOTP-module__card___3cs2p",Ue="verifyOTP-module__title___fZ-1d",De="verifyOTP-module__subtitle___dGSu3",He="verifyOTP-module__error___GEtlG",Ke="verifyOTP-module__success___46TjG",$e="verifyOTP-module__form___jiGG-",Je="verifyOTP-module__label___Zq5Mi",We="verifyOTP-module__timer___smq-a",Ze="verifyOTP-module__input___yqIXM",Qe="verifyOTP-module__resend___PlmkG",Xe="verifyOTP-module__button___8pIuO",Ye="verifyOTP-module__toggle___wbzVa";S(".verifyOTP-module__container___wgoDE{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyOTP-module__card___3cs2p{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyOTP-module__title___fZ-1d{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyOTP-module__subtitle___dGSu3{color:#9ca3af;font-size:.875rem;margin-bottom:1.5rem;text-align:center}.verifyOTP-module__error___GEtlG{color:#f87171;margin-bottom:1rem;text-align:center}.verifyOTP-module__success___46TjG{color:#34d399;margin-bottom:.75rem;text-align:center}.verifyOTP-module__form___jiGG-{display:flex;flex-direction:column;gap:1rem}.verifyOTP-module__label___Zq5Mi{color:#d1d5db;display:block;font-size:.875rem;margin-bottom:.25rem}.verifyOTP-module__timer___smq-a{color:#facc15;font-size:.875rem}.verifyOTP-module__input___yqIXM{background-color:#374151;border:1px solid #4b5563;border-radius:.375rem;color:#fff;outline:none;padding:.5rem;width:100%}.verifyOTP-module__input___yqIXM:focus{box-shadow:0 0 0 2px #3b82f6}.verifyOTP-module__resend___PlmkG{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.75rem;margin-top:.25rem;text-decoration:underline}.verifyOTP-module__resend___PlmkG:hover{color:#3b82f6}.verifyOTP-module__button___8pIuO{background-color:#2563eb;border:none;border-radius:.375rem;color:#fff;cursor:pointer;padding:.5rem;transition:background-color .2s;width:100%}.verifyOTP-module__button___8pIuO:hover{background-color:#1d4ed8}.verifyOTP-module__toggle___wbzVa{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}");const eo=()=>{const r=d(),{apiHost:n,mode:t}=N(),[l,s]=i(""),[c,_]=i(""),[m,u]=i(null),[g,p]=i(null),[h,f]=i(""),[y,b]=i(!1),[v,w]=i(""),[x,P]=i(300),[C,S]=i(300),T=k({authMode:t,authHost:n}),O=async()=>{b(!0);try{if(!m){(await T("/otp/verify-phone-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:c}),credentials:"include"})).ok?u(!0):f("Verification failed.")}}catch(e){console.error(e),f("Verification failed.")}b(!1)},M=async()=>{b(!0);try{if(!g){(await T("/otp/verify-email-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:l}),credentials:"include"})).ok?p(!0):f("Verification failed.")}}catch(e){console.error(e),f("Verification failed.")}b(!1)},L=e=>{w(""),"email"===e?((async()=>{f("");const e=await T("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(w("Verification email has been resent."),o.token&&localStorage.setItem("token",o.token)):f("Failed to send Email code. If this persists, refresh the page and try again.")})(),w("Verification email has been resent.")):((async()=>{f("");const e=await T("/otp/generate-phone-otp",{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(o.token&&localStorage.setItem("token",o.token),w("Verification SMS has been resent.")):f("Failed to send SMS code. If this persists, refresh the page and try again.")})(),w("Verification SMS has been resent."))},I=o=>!0===o?e("span",{className:"text-green-400 ml-2",children:"✅"}):!1===o?e("span",{className:"text-red-400 ml-2",children:"❌"}):null,E=e=>`${Math.floor(e/60).toString().padStart(2,"0")}:${(e%60).toString().padStart(2,"0")}`;return a(()=>{const e=setInterval(()=>{P(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{const e=setInterval(()=>{S(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{g&&m&&r("/registerPasskey")},[g,m,r]),e("div",{className:qe,children:o("div",{className:Re,children:[e("h2",{className:Ue,children:"Verify Your Contact Info"}),e("p",{className:De,children:"Enter the codes sent to your email and phone number."}),h&&e("p",{className:He,children:h}),v&&e("p",{className:Ke,children:v}),o("form",{onSubmit:async e=>{if(e.preventDefault(),f(""),6===l.length)if(6===c.length){b(!0);try{M(),O()}catch{f("Unexpected error occurred.")}finally{b(!1)}}else f("Please enter a valid code.");else f("Please enter a valid code.")},className:$e,children:[o("div",{children:[o("label",{htmlFor:"emailCode",className:Je,children:["Email Verification Code ",I(g)," -"," ",o("span",{className:We,children:["Code expires in: ",E(x)]})]}),e("input",{id:"emailCode",type:"text",maxLength:6,value:l,autoComplete:"off",onChange:e=>{s(e.target.value),p(null)},className:Ze,required:!0}),e("button",{type:"button",onClick:()=>L("email"),className:Qe,children:"Resend code to email"})]}),o("div",{children:[o("label",{htmlFor:"phoneCode",className:Je,children:["Phone Verification Code ",I(m)," -"," ",o("span",{className:We,children:["Code expires in: ",E(C)]})]}),e("input",{id:"phoneCode",type:"text",maxLength:6,pattern:"\\d{6}",inputMode:"numeric",value:c,autoComplete:"off",onChange:e=>{_(e.target.value),u(null)},className:Ze,required:!0}),e("button",{type:"button",onClick:()=>L("phone"),className:Qe,children:"Resend code to phone"})]}),e("button",{type:"submit",className:Xe,children:y?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>r("/login"),className:Ye,children:"Back to login"})]})]})})},oo=()=>o(c,{children:[e(_,{path:"/login",element:e(re,{})}),e(_,{path:"/passKeyLogin",element:e(ve,{})}),e(_,{path:"/mfaLogin",element:e(pe,{})}),e(_,{path:"/verifyOTP",element:e(eo,{})}),e(_,{path:"/registerPasskey",element:e(Ve,{})}),e(_,{path:"*",element:e(m,{to:"/login",replace:!0})})]});export{C as AuthProvider,oo as AuthRoutes,N as useAuth};
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{createContext as i,useContext as r,useState as t,useEffect as a,useCallback as l,useRef as s}from"react";import{useNavigate as d,useSearchParams as c,useLocation as _,Routes as m,Route as u,Navigate as g}from"react-router-dom";import{startAuthentication as p,startRegistration as h,WebAuthnError as f}from"@simplewebauthn/browser";import y,{AsYouType as b,parsePhoneNumberFromString as k}from"libphonenumber-js";const v=i(void 0),x=({value:o,children:n})=>e(v.Provider,{value:o,children:n}),w=()=>{const e=r(v);if(!e)throw new Error("useInternalAuth must be used within InternalAuthProvider");return e},N=e=>{const{authMode:o,authHost:n}=e;return async function(e,i){const r=`${n}${"server"===o?"auth":""}${e.startsWith("/")?e:`/${e}`}`,t={...i,credentials:"include",headers:{"Content-Type":"application/json",...i?.headers}},a=await fetch(r,t);if(a.ok)return a;throw console.warn("Auth fetch failed:",a.status,r),new Error(`Failed to make API call to ${r}`)}},P=()=>e("div",{className:"flex items-center justify-center min-h-screen bg-gray-900",children:e("div",{"data-testid":"loading",className:"w-12 h-12 border-4 border-gray-600 border-t-blue-500 rounded-full animate-spin"})});const C=i(void 0),T=()=>{const e=r(C);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},M=({children:n,apiHost:i,autoDetectPreviousSignin:r=!0,mode:s="web"})=>{const[d,c]=t(null),[_,m]=t([]),[u,g]=t(!1),[p,h]=t(!0),[f,y]=t(null),{hasSignedInBefore:b,markSignedIn:k}=function(e="seamlessauth_seen"){const[o,n]=t(!1);return a(()=>{try{"true"===localStorage.getItem(e)&&n(!0)}catch{}},[e]),{hasSignedInBefore:o,markSignedIn:()=>{try{localStorage.setItem(e,"true"),n(!0)}catch{}}}}(),[v]=t(s),w=N({authMode:v,authHost:i}),T=l(async()=>{if(d)try{await w("/logout",{method:"GET"})}catch{console.error("Error during logout")}finally{g(!1),c(null),y(null)}},[w,d]),M=async()=>{try{const e=await w("users/me",{method:"GET"});if(e.ok){const{user:o,credentials:n}=await e.json();c(o),m(n),g(!0)}else T()}catch{T()}finally{h(!1)}};return a(()=>{M()},[]),a(()=>{d&&u&&k()},[d,u,k]),p?o("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:[e(P,{}),";"]}):e(C.Provider,{value:{user:d,logout:T,deleteUser:async()=>{try{if((await w("/users/delete",{method:"delete"})).ok)return c(null),g(!1),void y(null);throw new Error("Could not delete user.")}catch(e){throw console.error("Something went wrong deleting user:",e),new Error("Could not delete user.")}},isAuthenticated:u,hasRole:e=>d?.roles?.includes(e),apiHost:i,token:f,markSignedIn:k,hasSignedInBefore:!!r&&b,mode:s,credentials:_,updateCredential:async e=>{const o=await w("users/credentials",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({friendlyName:e.friendlyName,id:e.id})});if(o.ok)return o.json();throw new Error("Failed to update credential")},deleteCredential:async e=>{const o=await w("users/credentials",{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(o.ok)return o.json();throw new Error("Failed to update credential")}},children:e(x,{value:{validateToken:M,setLoading:h},children:n})})};function S(e,o){void 0===o&&(o={});var n=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var I="login-module__container___YggDx",O="login-module__card___Ub-Py",E="login-module__heading___neEqb",j="login-module__inputGroup___P6qgS",A="login-module__label___mx5vu",B="login-module__input___U07lW",z="login-module__helperText___kDQ4-",F="login-module__error___40zxh",G="login-module__button___0kFBs",L="login-module__toggle___1JiG1",V="login-module__underline___gs-RS",H="login-module__phoneRow___oeNtq",q="login-module__select___rRV1O",D="login-module__phoneInput___2MPQC",R="login-module__fallbackCard___HdIk-",K="login-module__fallbackHeader___-il2v",U="login-module__fallbackDescription___ea5EB",J="login-module__fallbackActions___AD3ni",W="login-module__fallbackActionButton___lFgWf",$="login-module__actionTitle___ycrMp",Y="login-module__actionSubtext___opaIV",Z="login-module__linkButton___5lsoe";S(".login-module__container___YggDx{align-items:center;color:#fff;display:flex;justify-content:center}.login-module__card___Ub-Py{background-color:#1f2937;border-radius:.5rem;box-shadow:0 4px 6px rgba(0,0,0,.1);max-width:28rem;padding:2rem;width:100%}.login-module__heading___neEqb{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1.5rem;text-align:center}.login-module__message___qSejT{color:#68d391;text-align:center}.login-module__inputGroup___P6qgS{margin-bottom:1rem}.login-module__label___mx5vu{color:#d1d5db;display:block}.login-module__input___U07lW{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;margin-top:.25rem;padding:.5rem;width:100%}.login-module__input___U07lW:focus{box-shadow:0 0 0 2px #3b82f6;outline:none}.login-module__helperText___kDQ4-{color:#9ca3af;font-size:.75rem;margin-top:.5rem}.login-module__error___40zxh{color:#f87171;font-size:.875rem}.login-module__button___0kFBs{background-color:#2563eb;border-radius:.375rem;color:#fff;cursor:pointer;margin-top:1rem;padding:.5rem;transition:background-color .3s;width:100%}.login-module__button___0kFBs:hover{background-color:#1d4ed8}.login-module__button___0kFBs:disabled{background-color:#9ca3af;cursor:not-allowed}.login-module__toggle___1JiG1{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.login-module__underline___gs-RS{text-decoration:underline}.login-module__phoneRow___oeNtq{display:grid;gap:.5rem;grid-template-columns:1fr 3fr;margin-top:.25rem}.login-module__phoneInput___2MPQC,.login-module__select___rRV1O{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;padding:.5rem;width:100%}@media (max-width:500px){.login-module__phoneRow___oeNtq{grid-template-columns:1fr}}.login-module__fallbackCard___HdIk-{background:hsla(0,0%,100%,.04);border:1px solid hsla(0,0%,100%,.08);border-radius:12px;display:flex;flex-direction:column;gap:14px;margin-top:18px;padding:18px}.login-module__fallbackHeader___-il2v{color:#f3f4f6;font-size:.95rem;font-weight:600}.login-module__fallbackDescription___ea5EB{color:#9ca3af;font-size:.85rem;line-height:1.4}.login-module__fallbackActions___AD3ni{display:flex;flex-direction:column;gap:10px}.login-module__fallbackActionButton___lFgWf{background:rgba(0,0,0,.25);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;cursor:pointer;display:flex;flex-direction:column;padding:12px 14px;text-align:left;transition:all .15s ease}.login-module__fallbackActionButton___lFgWf:hover{background:hsla(0,0%,100%,.06);border-color:hsla(0,0%,100%,.15)}.login-module__actionTitle___ycrMp{color:#f9fafb;font-size:.9rem;font-weight:500}.login-module__actionSubtext___opaIV{color:#9ca3af;font-size:.75rem;margin-top:2px}.login-module__linkButton___5lsoe{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.8rem;margin-top:6px}.login-module__linkButton___5lsoe:hover{text-decoration:underline}");var Q="termsModal-module__overlay___-j6r5",X="termsModal-module__modal___4PxZV",ee="termsModal-module__header___B7wxb",oe="termsModal-module__title___Sucwt",ne="termsModal-module__closeBtn___evIs5",ie="termsModal-module__content___5BDhN",re="termsModal-module__link___oPZrU";S(".termsModal-module__overlay___-j6r5{align-items:center;background-color:rgba(0,0,0,.7);display:flex;inset:0;justify-content:center;position:fixed;z-index:999}.termsModal-module__modal___4PxZV{background-color:#1a1a1a;border-radius:8px;box-shadow:0 10px 25px rgba(0,0,0,.4);color:#fff;max-height:80vh;max-width:640px;outline:none;overflow-y:auto;padding:24px;width:100%}.termsModal-module__header___B7wxb{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.termsModal-module__title___Sucwt{color:#60a5fa;font-size:1.25rem;font-weight:700}.termsModal-module__closeBtn___evIs5{background:none;border:none;color:#ccc;cursor:pointer;font-size:1.75rem}.termsModal-module__closeBtn___evIs5:hover{color:#fff}.termsModal-module__content___5BDhN{color:#d1d5db;font-size:.9rem;line-height:1.6}.termsModal-module__link___oPZrU{color:#60a5fa;text-decoration:underline}.termsModal-module__link___oPZrU:hover{text-decoration:none}");const te=({isOpen:n,onClose:i})=>{const r=s(null);return a(()=>{const e=e=>{"Escape"===e.key&&i()};return n&&(document.addEventListener("keydown",e),r.current?.focus()),()=>{document.removeEventListener("keydown",e)}},[n,i]),n?e("div",{className:Q,role:"dialog","aria-modal":"true","aria-labelledby":"terms-title",children:o("div",{className:X,tabIndex:-1,ref:r,children:[o("div",{className:ee,children:[e("h2",{id:"terms-title",className:oe,children:"SMS Terms & Conditions"}),e("button",{onClick:i,className:ne,children:"×"})]}),o("div",{className:ie,children:[o("p",{children:[e("strong",{children:"Effective Date:"})," June 01, 2025"]}),e("p",{children:"By providing your phone number to SeamlessAuth, a Fells Code LLC product, you agree to receive SMS messages for identity verification, authentication, and account security."}),o("p",{children:[e("strong",{children:"1. Purpose:"})," SMS is used only for account security (OTP, MFA). No marketing messages."]}),o("p",{children:[e("strong",{children:"2. Frequency:"})," Based on login and account activity."]}),o("p",{children:[e("strong",{children:"3. Opt-Out:"})," Contact support@seamlessauth.com to opt out."]}),o("p",{children:[e("strong",{children:"4. Fees:"})," Message and data rates may apply."]}),o("p",{children:[e("strong",{children:"5. Supported Carriers:"})," Most major providers supported, delivery not guaranteed."]}),o("p",{children:[e("strong",{children:"6. Privacy:"})," Your phone number is not shared or sold. See our Privacy Policy."]}),o("p",{children:[e("strong",{children:"7. Changes:"})," Terms may be updated with notice on this page."]}),o("p",{children:["Questions? Email us at"," ",e("a",{className:re,href:"mailto:support@seamlessauth.com",children:"support@seamlessauth.com"}),"."]})]})]})}):null},ae=[{code:"US",name:"United States",dialCode:"+1",flag:"🇺🇸"},{code:"CA",name:"Canada",dialCode:"+1",flag:"🇨🇦"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"🇬🇧"},{code:"IN",name:"India",dialCode:"+91",flag:"🇮🇳"},{code:"AU",name:"Australia",dialCode:"+61",flag:"🇦🇺"}];function le({phone:n,setPhone:i,phoneError:r,setPhoneError:l}){const[s,d]=t(!1),[c,_]=t(ae[0]);a(()=>{const e=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().locale||"en-US",o=e.split("-")[1]?.toUpperCase()||"US";return ae.find(e=>e.code===o)||ae[0]}catch{return ae[0]}}();_(e)},[]);return o("div",{className:j,children:[e("label",{id:"phone",className:A,children:"Phone Number"}),o("div",{className:H,children:[e("select",{value:c.code,onChange:e=>{const o=ae.find(o=>o.code===e.target.value);if(o){_(o);const e=n.replace(/^\+\d+/,""),r=(new b).input(o.dialCode+e);i(r)}},className:q,children:ae.map(e=>o("option",{value:e.code,children:[e.flag," (",e.dialCode,")"]},e.code))}),e("input",{"aria-labelledby":"phone",type:"tel",value:n,onChange:e=>{const o=e.target.value,n=o.startsWith(c.dialCode)?o:c.dialCode+o,t=(new b).input(n);i(t),r&&l("")},onBlur:()=>{if(n){const e=k(n),o=e?.isValid();l(o?"":"Please enter a valid phone number.")}},autoComplete:"off",placeholder:"(555) 123-4567",className:D})]}),o("p",{className:z,children:["By signing up, you agree to our"," ",e("button",{onClick:()=>d(!0),className:V,children:"SMS Terms & Conditions"}),"."]}),r&&e("p",{className:F,children:r}),e(te,{isOpen:s,onClose:()=>d(!1)})]})}const se=e=>{if("string"!=typeof e)return!1;const o=e.trim();if(o.length<3||o.length>320)return!1;const n=o.split("@");if(2!==n.length)return!1;const[i,r]=n;return!(!/^[A-Za-z0-9._%+-]+$/.test(i)||i.startsWith(".")||i.endsWith(".")||i.includes(".."))&&!(!/^[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(r)||r.startsWith("-")||r.endsWith("-")||r.startsWith(".")||r.endsWith(".")||r.includes(".."))},de=e=>{const o=y(e);return o?.isValid()||!1};async function ce(){if(window.PublicKeyCredential&&"function"==typeof window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable)try{return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}catch(e){return console.error("Error checking passkey support:",e),!1}return!1}const _e=({identifier:n,onMagicLink:i,onPhoneOtp:r,onPasskeyRetry:t})=>{const a=se(n),l=de(n);return o("div",{className:R,children:[e("div",{className:K,children:"Passkeys unavailable on this device"}),e("p",{className:U,children:"Choose another secure sign-in method."}),o("div",{className:J,children:[a&&o("button",{type:"button",className:W,onClick:i,children:[e("span",{className:$,children:"Email Magic Link"}),e("span",{className:Y,children:"Send a secure sign-in link to your email"})]}),l&&o("button",{type:"button",className:W,onClick:r,children:[e("span",{className:$,children:"Text Message Code"}),e("span",{className:Y,children:"Receive a one-time code via SMS"})]})]}),e("button",{type:"button",className:Z,onClick:t,children:"Try passkey anyway"})]})},me=()=>{const i=d(),{apiHost:r,hasSignedInBefore:l,mode:s}=T(),{validateToken:c}=w(),[_,m]=t(""),[u,g]=t(""),[h,f]=t("register"),[y,b]=t(""),[k,v]=t(""),[x,P]=t(""),[C,M]=t(""),[S,V]=t(""),[H,q]=t(!1),[D,R]=t(!1),K=N({authMode:s,authHost:r});a(()=>{!async function(){const e=await ce();q(e)}(),l&&f("login")},[l]);const U=async()=>{try{const e=await K("/webAuthn/login/start",{method:"POST"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),n=await p({optionsJSON:o}),r=await K("/webAuthn/login/finish",{method:"POST",body:JSON.stringify({assertionResponse:n})});r.ok||console.error("Failed to verify passkey");const t=await r.json();if("Success"===t.message)return t.mfaLogin?void i("/mfaLogin"):(await c(),void i("/"));console.error("Passkey login failed:",t.message)}catch(e){console.error("Passkey login error:",e)}};return e("div",{className:I,children:o("div",{className:O,children:[e("h2",{className:E,children:"login"===h?"Sign In":"Create Account"}),e(n,{children:o("form",{onSubmit:async e=>{e.preventDefault(),"login"===h&&(async()=>{if(v(""),(await K("/login",{method:"POST",body:JSON.stringify({identifier:_,passkeyAvailable:H})})).ok)if(H)try{await U()}catch(e){console.error("Passkey login failed",e),R(!0)}else R(!0);else v("Failed to send login link. Please try again.")})(),"register"===h&&(async()=>{v("");try{const e=await K("/registration/register",{method:"POST",body:JSON.stringify({email:u,phone:y})});if(!e.ok)return void v("Failed to register. Please try again.");"Success"===(await e.json()).message&&i("/verifyPhoneOTP"),v("An unexpected error occured. Try again. If the problem persists, try resetting your password")}catch(e){console.error("Unexpected login error",e),v("An unexpected error occured. Try again. If the problem persists, try resetting your password")}})()},children:["login"===h&&o("div",{className:j,children:[e("label",{htmlFor:"identifier",className:A,children:"Email Address / Phone Number"}),e("input",{id:"identifier",type:"text",value:_,onChange:e=>{const o=e.target.value;m(o)},autoComplete:"off",placeholder:"Email or Phone Number",className:B,onBlur:()=>{if(_){const e=se(_)||de(_);V(e?"":"Please enter a valid email or phone number")}},required:!0}),e("p",{className:z,children:"Phone numbers must include a country code e.g. +1"}),D&&e(_e,{identifier:_,onMagicLink:async()=>{try{if(!(await K("/magic-link",{method:"GET"})).ok)return void v("Failed to send magic link.");i("/magic-link-sent")}catch(e){console.error(e),v("Failed to send magic link.")}},onPhoneOtp:async()=>{try{if(!(await K("/login/phone-otp",{method:"POST",body:JSON.stringify({identifier:_})})).ok)return void v("Failed to send OTP.");i("/verifyPhoneOTP")}catch(e){console.error(e),v("Failed to send OTP.")}},onPasskeyRetry:U}),S&&e("p",{className:F,children:S})]}),"register"===h&&o(n,{children:[o("div",{className:j,children:[e("label",{htmlFor:"email",className:A,children:"Email Address"}),e("input",{id:"email",type:"email",value:u,onChange:e=>{const o=e.target.value;g(o)},autoComplete:"off",className:B,onBlur:()=>{if(u){const e=se(u);M(e?"":"Please enter a valid email")}},required:!0}),C&&e("p",{className:F,children:C})]}),e(le,{phone:y,setPhone:b,phoneError:x,setPhoneError:P})]}),e("button",{type:"submit",className:G,disabled:!("login"===h&&_?se(_)||de(_):se(u)&&de(y)),children:"login"===h?"Login":"Register"}),k&&e("p",{className:F,children:k}),e("button",{type:"button",onClick:()=>f("login"===h?"register":"login"),className:L,children:"login"===h?"Don't have an account? Create one":"Already have an account? Sign in"})]})})]})})};var ue="passKeyLogin-module__container___IUKxF",ge="passKeyLogin-module__card___2sKM1",pe="passKeyLogin-module__title___HZxvc",he="passKeyLogin-module__button___FvR4I";S(".passKeyLogin-module__container___IUKxF{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.passKeyLogin-module__card___2sKM1{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);display:flex;flex-direction:column;gap:1.5rem;max-width:400px;padding:2rem;width:100%}.passKeyLogin-module__title___HZxvc{color:#fff;font-size:1.5rem;font-weight:600;text-align:center}.passKeyLogin-module__button___FvR4I{background-color:#2563eb;border:1px solid #3b82f6;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;text-align:center;transition:background-color .2s ease;width:100%}.passKeyLogin-module__button___FvR4I:hover{background-color:#1d4ed8}@media (max-width:480px){.passKeyLogin-module__card___2sKM1{padding:1.25rem}.passKeyLogin-module__button___FvR4I{font-size:1rem}}");const fe=()=>{const n=d(),{apiHost:i,mode:r}=T(),{validateToken:t}=w(),a=N({authMode:r,authHost:i});return e("div",{className:ue,children:o("div",{className:ge,children:[e("h2",{className:pe,children:"Login with Passkey"}),e("button",{onClick:async()=>{try{const e=await a("/webAuthn/login/start",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),i=await p({optionsJSON:o}),r=await a("/webAuthn/login/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:i}),credentials:"include"});r.ok||console.error("Failed to verify passkey");const l=await r.json();if("Success"===l.message)return l.mfaLogin&&n("/mfaLogin"),await t(),void n("/");console.error("Passkey login failed")}catch{console.error("Passkey login error")}},className:he,children:"Use Passkey"})]})})};var ye="registerPasskey-module__container___jqEh8",be="registerPasskey-module__card___MJAyC",ke="registerPasskey-module__loading___Q4i1x",ve="registerPasskey-module__spinner___V1nhd",xe="registerPasskey-module__supported___ihTih",we="registerPasskey-module__title___vn2Qu",Ne="registerPasskey-module__description___AWmO-",Pe="registerPasskey-module__button___D3b4B",Ce="registerPasskey-module__message___RiOw-",Te="registerPasskey-module__success___HP5aX",Me="registerPasskey-module__error___hGiqE";S(".registerPasskey-module__container___jqEh8{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.registerPasskey-module__card___MJAyC{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);max-width:400px;padding:1.5rem;width:100%}.registerPasskey-module__loading___Q4i1x{align-items:center;background-color:#f9fafb;border-radius:.75rem;box-shadow:0 2px 8px rgba(0,0,0,.1);color:#374151;display:flex;font-weight:500;gap:.75rem;justify-content:center;padding:1.5rem}.registerPasskey-module__spinner___V1nhd{animation:registerPasskey-module__spin___oYcsC 1s linear infinite;border-color:#3b82f6 transparent;border-radius:9999px;border-style:solid;border-width:2px;height:1.5rem;width:1.5rem}@keyframes registerPasskey-module__spin___oYcsC{to{transform:rotate(1turn)}}.registerPasskey-module__supported___ihTih{background-color:#ecfdf5;border-radius:.75rem;box-shadow:0 2px 12px rgba(0,0,0,.1);color:#065f46;padding:1.25rem}.registerPasskey-module__title___vn2Qu{font-size:1.125rem;font-weight:600;margin-bottom:.5rem}.registerPasskey-module__description___AWmO-{margin-bottom:1rem}.registerPasskey-module__button___D3b4B{background-color:#059669;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__button___D3b4B:hover{background-color:#047857}.registerPasskey-module__message___RiOw-{font-size:.875rem;margin-top:1rem}.registerPasskey-module__success___HP5aX{color:#6ee7b7}.registerPasskey-module__error___hGiqE{color:#f87171}");var Se="deviceNameModal-module__overlay___fmdPd",Ie="deviceNameModal-module__modal___uoEda",Oe="deviceNameModal-module__description___-HMTA",Ee="deviceNameModal-module__input___4vQMI",je="deviceNameModal-module__actions___KXw7b",Ae="deviceNameModal-module__primary___9Ozlk",Be="deviceNameModal-module__secondary___HILhc";S(".deviceNameModal-module__overlay___fmdPd{align-items:center;background:rgba(0,0,0,.45);display:flex;inset:0;justify-content:center;position:fixed;z-index:1000}.deviceNameModal-module__modal___uoEda{background:#1f2937;border-radius:12px;box-shadow:0 20px 40px rgba(0,0,0,.15);color:#fff;max-width:420px;padding:24px;width:100%}.deviceNameModal-module__description___-HMTA{color:#fff;font-size:14px;margin-bottom:16px}.deviceNameModal-module__input___4vQMI{border:1px solid #ddd;border-radius:8px;font-size:14px;margin-bottom:20px;padding:10px 12px;width:100%}.deviceNameModal-module__actions___KXw7b{display:flex;gap:10px;justify-content:flex-end}.deviceNameModal-module__primary___9Ozlk{background:#2563eb;border:none;border-radius:8px;color:#fff;cursor:pointer;padding:8px 14px}.deviceNameModal-module__secondary___HILhc{background:transparent;border:1px solid #ccc;border-radius:8px;cursor:pointer;padding:8px 14px}");const ze=({isOpen:n,onCancel:i,onConfirm:r})=>{const[a,l]=t("");return n?e("div",{className:Se,children:o("div",{className:Ie,children:[e("h3",{children:"Name This Device"}),e("p",{className:Oe,children:"Give this passkey a friendly name so you can recognize it later."}),e("input",{type:"text",placeholder:"e.g., MacBook Pro, iPhone, YubiKey",value:a,onChange:e=>l(e.target.value),className:Ee,autoFocus:!0}),o("div",{className:je,children:[e("button",{onClick:i,className:Be,children:"Cancel"}),e("button",{onClick:()=>r(a.trim()),disabled:!a.trim(),className:Ae,children:"Continue"})]})]})}):null},Fe=()=>{const{apiHost:i,mode:r}=T(),{validateToken:l}=w(),s=d(),[c,_]=t("idle"),[m,u]=t(""),[g,p]=t(!1),[y,b]=t(!1),[k,v]=t(null),x=N({authMode:r,authHost:i});a(()=>{!async function(){const e=await ce();p(e)}()},[]);const P=async(e,o)=>{if(!(await x("/webAuthn/register/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attestationResponse:e,metadata:o}),credentials:"include"})).ok)throw new Error("Verification failed");await l()};return o(n,{children:[e("div",{className:ye,children:e("div",{className:be,children:o("div",g?{className:xe,children:[e("h2",{className:we,children:"Secure Your Account with a Passkey"}),e("p",{className:Ne,children:"Your device supports passkeys! Register one to skip passwords forever."}),e("button",{onClick:()=>{const{platform:e,browser:o,deviceInfo:n}=function(){const e=navigator.userAgent.toLowerCase();let o="unknown",n="unknown";return/iphone|ipad|ipod/.test(e)?o="ios":/android/.test(e)?o="android":/mac os/.test(e)?o="mac":/windows/.test(e)?o="windows":/linux/.test(e)&&(o="linux"),/chrome/.test(e)&&(n="chrome"),/safari/.test(e)&&!/chrome/.test(e)&&(n="safari"),/firefox/.test(e)&&(n="firefox"),/edg/.test(e)&&(n="edge"),{platform:o,browser:n,deviceInfo:`${o} • ${n}`}}();v({platform:e,browser:o,deviceInfo:n}),b(!0)},disabled:"loading"===c,className:Pe,children:"loading"===c?"Registering...":"Register Passkey"}),m&&e("p",{className:`${Ce} ${"success"===c?Te:Me}`,children:m})]}:{className:ke,children:[e("div",{className:ve}),e("span",{children:"Checking for Passkey Support..."})]})})}),e(ze,{isOpen:y,onCancel:()=>{b(!1),v(null)},onConfirm:async e=>{if(!k)return;const{platform:o,browser:n,deviceInfo:i}=k;_("loading");try{const r=await x("/webAuthn/register/start",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!r.ok)throw new Error("Failed to fetch challenge");const t=await r.json();let a;try{a=await h({optionsJSON:t})}catch(e){if(e instanceof f)throw new Error(e.name);throw e}await P(a,{friendlyName:e,platform:o,browser:n,deviceInfo:i}),_("success"),u("Passkey registered successfully."),s("/")}catch(e){console.error(e),_("error"),u("Error registering passkey.")}finally{b(!1),v(null)}}})]})};var Ge="verifyOTP-module__container___wgoDE",Le="verifyOTP-module__card___3cs2p",Ve="verifyOTP-module__title___fZ-1d",He="verifyOTP-module__subtitle___dGSu3",qe="verifyOTP-module__error___GEtlG",De="verifyOTP-module__success___46TjG",Re="verifyOTP-module__form___jiGG-",Ke="verifyOTP-module__label___Zq5Mi",Ue="verifyOTP-module__timer___smq-a",Je="verifyOTP-module__input___yqIXM",We="verifyOTP-module__resend___PlmkG",$e="verifyOTP-module__button___8pIuO",Ye="verifyOTP-module__toggle___wbzVa";S(".verifyOTP-module__container___wgoDE{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyOTP-module__card___3cs2p{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyOTP-module__title___fZ-1d{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyOTP-module__subtitle___dGSu3{color:#9ca3af;font-size:.875rem;margin-bottom:1.5rem;text-align:center}.verifyOTP-module__error___GEtlG{color:#f87171;margin-bottom:1rem;text-align:center}.verifyOTP-module__success___46TjG{color:#34d399;margin-bottom:.75rem;text-align:center}.verifyOTP-module__form___jiGG-{display:flex;flex-direction:column;gap:1rem}.verifyOTP-module__label___Zq5Mi{color:#d1d5db;display:block;font-size:.875rem;margin-bottom:.25rem}.verifyOTP-module__timer___smq-a{color:#facc15;font-size:.875rem}.verifyOTP-module__input___yqIXM{background-color:#374151;border:1px solid #4b5563;border-radius:.375rem;color:#fff;outline:none;padding:.5rem;width:100%}.verifyOTP-module__input___yqIXM:focus{box-shadow:0 0 0 2px #3b82f6}.verifyOTP-module__resend___PlmkG{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.75rem;margin-top:.25rem;text-decoration:underline}.verifyOTP-module__resend___PlmkG:hover{color:#3b82f6}.verifyOTP-module__button___8pIuO{background-color:#2563eb;border:none;border-radius:.375rem;color:#fff;cursor:pointer;padding:.5rem;transition:background-color .2s;width:100%}.verifyOTP-module__button___8pIuO:hover{background-color:#1d4ed8}.verifyOTP-module__toggle___wbzVa{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}");var Ze="otpInput-module__otpContainer___MUjby",Qe="otpInput-module__otpInput___3YMVm";S(".otpInput-module__otpContainer___MUjby{display:flex;gap:8px;justify-content:center;margin-top:8px}.otpInput-module__otpInput___3YMVm{background:#374151;border:1px solid #4b5563;border-radius:8px;color:#fff;font-size:1.2rem;height:48px;text-align:center;transition:border-color .15s ease,box-shadow .15s ease;width:42px}.otpInput-module__otpInput___3YMVm:focus{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.25);outline:none}");const Xe=({length:o=6,value:n,onChange:i})=>{const r=s([]),t=n.split("").concat(Array(o).fill("")).slice(0,o);return e("div",{className:Ze,onPaste:e=>{const n=e.clipboardData.getData("text").replace(/\D/g,"");n.length===o&&(i(n),r.current[o-1]?.focus()),e.preventDefault()},children:t.map((o,a)=>e("input",{ref:e=>r.current[a]=e,type:"text",inputMode:"numeric",maxLength:1,value:o||"",className:Qe,onChange:e=>((e,o)=>{if(!/^\d?$/.test(o))return;const t=n.substring(0,e)+o+n.substring(e+1);i(t.trim()),o&&r.current[e+1]&&r.current[e+1]?.focus()})(a,e.target.value),onKeyDown:e=>((e,o)=>{"Backspace"===o.key&&!t[e]&&r.current[e-1]&&r.current[e-1]?.focus()})(a,e)},a))})},eo=()=>{const n=d(),{apiHost:i,mode:r}=T(),[l,s]=t(""),[c,_]=t(null),[m,u]=t(""),[g,p]=t(!1),[h,f]=t(""),[y,b]=t(300),k=N({authMode:r,authHost:i}),v=async()=>{p(!0);try{if(!c){(await k("/otp/verify-phone-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:l}),credentials:"include"})).ok?_(!0):u("Verification failed.")}}catch(e){console.error(e),u("Verification failed.")}p(!1)},x=async()=>{f(""),await(async()=>{u("");const e=await k("/otp/generate-phone-otp",{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(o.token&&localStorage.setItem("token",o.token),f("Verification SMS has been resent.")):u("Failed to send SMS code. If this persists, refresh the page and try again.")})(),f("Verification SMS has been resent.")};return a(()=>{const e=setInterval(()=>{b(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{c&&(async()=>{(await k("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}})).ok?n("/verifyEmailOTP"):u("Failed to send Email code. If this persists, refresh the page and try registering again.")})()},[c,n,k]),e("div",{className:Ge,children:o("div",{className:Le,children:[e("h2",{className:Ve,children:"Verify Your Phone Number"}),e("p",{className:He,children:"Enter the code sent to your phone number."}),m&&e("p",{className:qe,children:m}),h&&e("p",{className:De,children:h}),o("form",{onSubmit:async e=>{if(e.preventDefault(),u(""),6===l.length){p(!0);try{v()}catch{u("Unexpected error occurred.")}finally{p(!1)}}else u("Please enter a valid code.")},className:Re,children:[o("div",{children:[o("label",{htmlFor:"phoneCode",className:Ke,children:["Phone Verification Code ",(P=c,!0===P?e("span",{className:"text-green-400 ml-2",children:"✅"}):!1===P?e("span",{className:"text-red-400 ml-2",children:"❌"}):null)," -"," ",o("span",{className:Ue,children:["Code expires in: ",(w=y,`${Math.floor(w/60).toString().padStart(2,"0")}:${(w%60).toString().padStart(2,"0")}`)]})]}),e(Xe,{length:6,value:l,onChange:s}),e("button",{type:"button",onClick:()=>x(),className:We,children:"Resend code to phone"})]}),e("button",{type:"submit",className:$e,children:g?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>n("/login"),className:Ye,children:"Back to login"})]})]})});var w,P},oo=()=>{const n=d(),{apiHost:i,mode:r}=T(),{validateToken:l}=w(),[s,c]=t(!1),[_,m]=t(""),[u,g]=t(300),[p,h]=t(""),[f,y]=t(""),[b,k]=t(!1),v=N({authMode:r,authHost:i});return a(()=>{const e=setInterval(()=>{g(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{!async function(){const e=await ce();k(e)}()},[]),e("div",{className:Ge,children:o("div",{className:Le,children:[e("h2",{className:Ve,children:"Verify Your Email"}),e("p",{className:He,children:"We sent you a verification email. Enter the code below."}),p&&e("p",{className:qe,children:p}),f&&e("p",{className:De,children:f}),o("form",{onSubmit:async e=>{if(e.preventDefault(),h(""),6===_.length){c(!0);try{if(!(await v("/otp/verify-email-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:_}),credentials:"include"})).ok)return void h("Verification failed.");b?n("/registerPasskey"):(await l(),n("/"))}catch(e){console.error(e),h("Verification failed.")}finally{c(!1)}}else h("Please enter a valid code.")},className:Re,children:[o("div",{children:[o("label",{htmlFor:"emailCode",className:Ke,children:["Email Verification Code",o("span",{className:Ue,children:[" ","— Code expires in ",(x=u,`${Math.floor(x/60).toString().padStart(2,"0")}:${(x%60).toString().padStart(2,"0")}`)]})]}),e("input",{id:"emailCode",type:"text",maxLength:6,value:_,autoComplete:"off",onChange:e=>m(e.target.value),className:Je,required:!0}),e("button",{type:"button",onClick:async()=>{h(""),y("");(await v("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}})).ok?y("Verification email has been resent."):h("Failed to send Email code. If this persists, refresh the page and try again.")},className:We,children:"Resend code to email"})]}),e("button",{type:"submit",className:$e,disabled:s,children:s?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>n("/login"),className:Ye,children:"Back to login"})]})]})});var x};var no={container:"verifyMagiclink-module__container___qrSXf",card:"verifyMagiclink-module__card___niKgr",title:"verifyMagiclink-module__title___SumxD",verificationContent:"verifyMagiclink-module__verificationContent___NdsS0",spinner:"verifyMagiclink-module__spinner___lnW1k",successIcon:"verifyMagiclink-module__successIcon___XjFEM",checkIcon:"verifyMagiclink-module__checkIcon___I0JOP",successText:"verifyMagiclink-module__successText___lO5Qq"};S(".verifyMagiclink-module__container___qrSXf{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyMagiclink-module__card___niKgr{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyMagiclink-module__title___SumxD{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyMagiclink-module__verificationContent___NdsS0{align-items:center;display:flex;flex-direction:column;gap:14px;margin:20px 0}.verifyMagiclink-module__spinner___lnW1k{animation:verifyMagiclink-module__spin___2lGzj .9s linear infinite;border:3px solid hsla(0,0%,100%,.15);border-radius:50%;border-top-color:#60a5fa;height:28px;width:28px}.verifyMagiclink-module__successIcon___XjFEM{align-items:center;background:rgba(16,185,129,.15);border-radius:50%;display:flex;height:36px;justify-content:center;width:36px}.verifyMagiclink-module__checkIcon___I0JOP{animation:verifyMagiclink-module__checkPop___-3qJu .25s ease-out;color:#34d399;height:22px;width:22px}.verifyMagiclink-module__successText___lO5Qq{color:#34d399;font-size:.9rem}@keyframes verifyMagiclink-module__checkPop___-3qJu{0%{opacity:0;transform:scale(.6)}80%{transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@keyframes verifyMagiclink-module__spin___2lGzj{to{transform:rotate(1turn)}}");const io=()=>{const[n]=c(),i=d(),r=n.get("token"),{apiHost:l,mode:s}=T(),[_,m]=t(""),[u,g]=t(""),p=N({authMode:s,authHost:l});return a(()=>{r?(async()=>{if(!(await p(`/magic-link/verify/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}})).ok)return console.error("Failed to verify token"),void m("Failed to verify token");new BroadcastChannel("seamless-auth").postMessage({type:"MAGIC_LINK_AUTH_SUCCESS"}),g("You have been verified on the device and browser that initiated this request"),setTimeout(()=>{i("/")},900)})():(m("Missing token for verification."),console.error("No token found",r))},[r,p,i]),e("div",{className:no.container,children:o("div",{className:no.card,children:[e("h1",{className:no.title,children:"Verifying your login"}),o("div",{className:no.verificationContent,children:[!u&&!_&&e("div",{className:no.spinner}),u&&e("div",{className:no.successIcon,children:e("svg",{viewBox:"0 0 24 24",className:no.checkIcon,fill:"none",stroke:"currentColor",strokeWidth:"2",children:e("path",{d:"M5 13l4 4L19 7"})})}),!u&&!_&&e("p",{className:no.helperText,children:"Please wait while we securely verify your sign-in link."}),u&&e("p",{className:no.successText,children:"Login verified. Redirecting…"}),_&&e("p",{className:no.error,children:_})]})]})})};var ro="magiclink-module__container___45zcA",to="magiclink-module__card___Au9oN",ao="magiclink-module__iconWrapper___k5ndr",lo="magiclink-module__mailIcon___Pwb7q",so="magiclink-module__iconRing___bdLvf",co="magiclink-module__heading___b9cre",_o="magiclink-module__message___kiVFj",mo="magiclink-module__identifier___JtcFM",uo="magiclink-module__helperText___7Mlfh",go="magiclink-module__actions___64I-3",po="magiclink-module__secondaryButton___BntAI",ho="magiclink-module__cooldown___Ib4rm",fo="magiclink-module__linkButton___maJiv";S(".magiclink-module__container___45zcA{align-items:center;color:#fff;display:flex;justify-content:center}.magiclink-module__card___Au9oN{background-color:#1f2937;border-radius:.75rem;box-shadow:0 10px 25px rgba(0,0,0,.25);max-width:420px;padding:2.5rem 2rem;text-align:center;width:100%}.magiclink-module__iconWrapper___k5ndr{display:flex;justify-content:center;margin-bottom:1.25rem;position:relative}.magiclink-module__mailIcon___Pwb7q{color:#a5b4fc;height:38px;width:38px;z-index:2}.magiclink-module__iconRing___bdLvf{animation:magiclink-module__pulse___YGm-I 2s infinite;background:rgba(99,102,241,.15);border-radius:50%;height:72px;position:absolute;width:72px}@keyframes magiclink-module__pulse___YGm-I{0%{opacity:.8;transform:scale(.6)}70%{opacity:0;transform:scale(1.4)}to{opacity:0}}.magiclink-module__heading___b9cre{font-size:1.55rem;font-weight:600;margin-bottom:.75rem}.magiclink-module__message___kiVFj{color:#d1d5db;font-size:.95rem;line-height:1.4;margin-bottom:1rem}.magiclink-module__identifier___JtcFM{background:hsla(0,0%,100%,.05);border-radius:6px;display:inline-block;font-size:1rem;font-weight:600;margin-bottom:1rem;padding:.45rem .6rem}.magiclink-module__helperText___7Mlfh{color:#9ca3af;font-size:.85rem;line-height:1.4;margin-bottom:.6rem}.magiclink-module__actions___64I-3{display:flex;flex-direction:column;gap:.6rem;margin-top:1.6rem}.magiclink-module__secondaryButton___BntAI{background:#111827;border:1px solid #374151;border-radius:8px;color:#fff;cursor:pointer;font-weight:500;padding:.65rem}.magiclink-module__secondaryButton___BntAI:hover:not(:disabled){background:#1f2937}.magiclink-module__secondaryButton___BntAI:disabled{cursor:not-allowed;opacity:.5}.magiclink-module__cooldown___Ib4rm{color:#9ca3af;font-size:.8rem}.magiclink-module__linkButton___maJiv{background:none;border:none;color:#a5b4fc;cursor:pointer;font-size:.85rem;margin-top:.4rem}.magiclink-module__linkButton___maJiv:hover{text-decoration:underline}");const yo=()=>{const{apiHost:n,mode:i}=T(),{validateToken:r}=w(),l=d(),s=_(),c=N({authMode:i,authHost:n}),m=s.state?.identifier,[u,g]=t(30);a(()=>{const e=setInterval(()=>{g(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]);return a(()=>{const e=new BroadcastChannel("seamless-auth");return e.onmessage=async e=>{if("MAGIC_LINK_AUTH_SUCCESS"===e.data?.type){200===(await c("/magic-link/check",{method:"GET",headers:{"Content-Type":"application/json"}})).status&&(await r(),l("/"))}},()=>{e.close()}},[c,l,r]),a(()=>{const e=setInterval(async()=>{try{200===(await c("/magic-link/check",{method:"GET",headers:{"Content-Type":"application/json"}})).status&&(await r(),l("/"))}catch{}},5e3);return()=>clearInterval(e)},[n,r,l]),e("div",{className:ro,children:o("div",{className:to,children:[o("div",{className:ao,children:[e("div",{className:so}),o("svg",{className:lo,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e("path",{d:"M4 6h16v12H4z"}),e("path",{d:"m4 6 8 6 8-6"})]})]}),e("h2",{className:co,children:"Check your email"}),e("p",{className:_o,children:"If an account exists for this address, we sent a secure sign-in link."}),e("div",{className:mo,children:m}),e("p",{className:uo,children:"Open the email and click the link to finish signing in."}),e("p",{className:uo,children:"Didn’t receive anything? Check your spam folder or try creating a new account."}),o("div",{className:go,children:[e("button",{className:po,disabled:u>0,onClick:async()=>{u>0||(await c("/magic-link",{method:"GET",headers:{"Content-Type":"application/json"}}),g(30))},children:"Resend link"}),u>0&&o("div",{className:ho,children:["Available in ",u,"s"]}),e("button",{className:fo,onClick:()=>l("/login"),children:"Change email or phone"})]})]})})},bo=()=>o(m,{children:[e(u,{path:"/login",element:e(me,{})}),e(u,{path:"/passKeyLogin",element:e(fe,{})}),e(u,{path:"/verifyPhoneOTP",element:e(eo,{})}),e(u,{path:"/verifyEmailOTP",element:e(oo,{})}),e(u,{path:"/verify-magiclink",element:e(io,{})}),e(u,{path:"/registerPasskey",element:e(Fe,{})}),e(u,{path:"/magic-link-sent",element:e(yo,{})}),e(u,{path:"*",element:e(g,{to:"/login",replace:!0})})]});export{M as AuthProvider,bo as AuthRoutes,T as useAuth};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/context/InternalAuthContext.tsx","../src/fetchWithAuth.ts","../src/LoadingSpinner.tsx","../src/AuthProvider.tsx","../src/hooks/usePreviousSignIn.ts","../node_modules/style-inject/dist/style-inject.es.js","../src/TermsModal.tsx","../src/components/phoneInput.tsx","../src/utils.ts","../src/Login.tsx","../src/MfaLogin.tsx","../src/PassKeyLogin.tsx","../src/components/DeviceNameModal.tsx","../src/RegisterPassKey.tsx","../src/VerifyOTP.tsx","../src/AuthRoutes.tsx"],"sourcesContent":[null,null,null,null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null,null,null,null,null],"names":["InternalAuthContext","createContext","undefined","InternalAuthProvider","value","children","_jsx","Provider","useInternalAuth","context","useContext","Error","createFetchWithAuth","opts","authMode","authHost","async","input","init","url","startsWith","requestInit","credentials","headers","response","fetch","ok","console","warn","status","LoadingSpinner","className","AuthContext","useAuth","AuthProvider","apiHost","autoDetectPreviousSignin","mode","user","setUser","useState","setCredentials","isAuthenticated","setIsAuthenticated","loading","setLoading","token","setToken","hasSignedInBefore","markSignedIn","storageKey","setHasSignedInBefore","useEffect","localStorage","getItem","setItem","usePreviousSignIn","fetchWithAuth","logout","useCallback","method","error","validateToken","json","_jsxs","deleteUser","hasRole","role","roles","includes","updateCredential","credential","body","JSON","stringify","friendlyName","id","deleteCredential","credentialId","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TermsModal","isOpen","onClose","modalRef","useRef","handleKeyDown","e","key","addEventListener","current","focus","removeEventListener","styles","tabIndex","onClick","href","countries","code","name","dialCode","flag","PhoneInputWithCountryCode","phone","setPhone","phoneError","setPhoneError","showModal","setShowModal","selectedCountry","setSelectedCountry","defaultCountry","locale","Intl","DateTimeFormat","resolvedOptions","countryCode","split","toUpperCase","find","c","getDefaultCountry","onChange","country","target","stripped","replace","newPhone","AsYouType","map","raw","full","formatted","onBlur","parsed","parsePhoneNumberFromString","isValid","autoComplete","placeholder","isValidEmail","email","normalized","trim","length","parts","localPart","domainPart","test","endsWith","isValidPhoneNumber","phoneNumber","isPasskeySupported","window","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","Login","navigate","useNavigate","identifier","setIdentifier","setEmail","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","passkeyAvailable","setPasskeyAvailable","supported","checkSupport","login","options","startAuthentication","optionsJSON","verificationResponse","assertionResponse","verificationResult","message","mfaLogin","handlePasskeyLogin","err","_Fragment","onSubmit","preventDefault","register","htmlFor","required","disabled","MfaLogin","OTP","setOTP","setError","resendMsg","setResendMsg","timeLeft","setTimeLeft","selectedMethod","setSelectedMethod","verifyOTP","endpoint","verificationToken","sendOTP","interval","setInterval","prev","clearInterval","seconds","Math","floor","toString","padStart","maxLength","PassKeyLogin","DeviceNameModal","onCancel","onConfirm","setValue","autoFocus","RegisterPasskey","setStatus","setMessage","showDeviceModal","setShowDeviceModal","pendingMetadata","setPendingMetadata","verifyPassKey","attResp","metadata","attestationResponse","platform","browser","deviceInfo","ua","navigator","userAgent","toLowerCase","parseUserAgent","challengeRes","startRegistration","WebAuthnError","VerifyOTP","emailOtp","setEmailOtp","phoneOtp","setPhoneOtp","phoneVerified","setPhoneVerified","emailVerified","setEmailVerified","emailTimeLeft","setEmailTimeLeft","phoneTimeLeft","setPhoneTimeLeft","verifyPhoneOTP","verifyEmailOTP","handleResend","data","onResendEmail","onResendPhone","getStatusIcon","verified","formatTime","pattern","inputMode","AuthRoutes","Routes","Route","path","element","Navigate","to"],"mappings":"6bAOA,MAAMA,EAAsBC,OAAmDC,GAElEC,EAAuB,EAClCC,QACAC,cAMEC,EAACN,EAAoBO,SAAQ,CAACH,MAAOA,EAAKC,SAAGA,IAKpCG,EAAkB,KAC7B,MAAMC,EAAUC,EAAWV,GAC3B,IAAKS,EACH,MAAM,IAAIE,MAAM,4DAElB,OAAOF,GCpBIG,EA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tG,SAAA,CAAA,2BACvB8Q,EAAcd,QAAkB,IACzDrM,UAAMjC,UAAW4E,GAAYtG,SAAA,CAAA,oBACTgR,EAAWV,SAGjCrQ,EAAA,QAAA,CACEsE,GAAG,YACHY,KAAK,OACL2I,UAAW,EACXmD,QAAQ,SACRC,UAAU,UACVnR,MAAO+P,EACP5G,aAAa,MACbf,SAAUnC,IACR+J,EAAY/J,EAAEqC,OAAOtI,OACrBkQ,EAAiB,OAEnBvO,UAAW4E,GACX+F,UAAQ,IAEVpM,YACEkF,KAAK,SACLqB,QAAS,IAAMkK,EAAa,SAC5BhP,UAAW4E,GAAatG,SAAA,4BAM5BC,EAAA,SAAA,CAAQkF,KAAK,SAASzD,UAAW4E,GAAatG,SAC3CuC,EAAU,eAAiB,sBAG9BtC,YACEkF,KAAK,SACLqB,QAAS,IAAM6D,EAAS,UACxB3I,UAAW4E,GAAatG,SAAA,2BCrRvBmR,GAAa,IACxBxN,EAACyN,EAAM,CAAApR,SAAA,CACLC,EAACoR,EAAK,CAACC,KAAK,SAASC,QAAStR,EAACmK,GAAK,CAAA,KACpCnK,EAACoR,GAAMC,KAAK,gBAAgBC,QAAStR,EAAC8N,GAAY,CAAA,KAClD9N,EAACoR,EAAK,CAACC,KAAK,YAAYC,QAAStR,EAACsM,GAAQ,CAAA,KAC1CtM,EAACoR,EAAK,CAACC,KAAK,aAAaC,QAAStR,EAAC0P,SACnC1P,EAACoR,EAAK,CAACC,KAAK,mBAAmBC,QAAStR,EAACoO,GAAe,CAAA,KACxDpO,EAACoR,GAAMC,KAAK,IAAIC,QAAStR,EAACuR,EAAQ,CAACC,GAAG,SAASlJ,SAAO","x_google_ignoreList":[5]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/context/InternalAuthContext.tsx","../src/fetchWithAuth.ts","../src/components/LoadingSpinner.tsx","../src/AuthProvider.tsx","../src/hooks/usePreviousSignIn.ts","../node_modules/style-inject/dist/style-inject.es.js","../src/components/TermsModal.tsx","../src/components/phoneInput.tsx","../src/utils.ts","../src/components/AuthFallbackOptions.tsx","../src/views/Login.tsx","../src/views/PassKeyLogin.tsx","../src/components/DeviceNameModal.tsx","../src/views/PassKeyRegistration.tsx","../src/components/OtpInput.tsx","../src/views/PhoneRegistration.tsx","../src/views/EmailRegistration.tsx","../src/views/VerifyMagicLink.tsx","../src/components/MagicLinkSent.tsx","../src/AuthRoutes.tsx"],"sourcesContent":[null,null,null,null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["InternalAuthContext","createContext","undefined","InternalAuthProvider","value","children","_jsx","Provider","useInternalAuth","context","useContext","Error","createFetchWithAuth","opts","authMode","authHost","async","input","init","url","startsWith","requestInit","credentials","headers","response","fetch","ok","console","warn","status","LoadingSpinner","className","AuthContext","useAuth","AuthProvider","apiHost","autoDetectPreviousSignin","mode","user","setUser","useState","setCredentials","isAuthenticated","setIsAuthenticated","loading","setLoading","token","setToken","hasSignedInBefore","markSignedIn","storageKey","setHasSignedInBefore","useEffect","localStorage","getItem","setItem","usePreviousSignIn","fetchWithAuth","logout","useCallback","method","error","validateToken","json","_jsxs","deleteUser","hasRole","role","roles","includes","updateCredential","credential","body","JSON","stringify","friendlyName","id","deleteCredential","credentialId","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TermsModal","isOpen","onClose","modalRef","useRef","handleKeyDown","e","key","addEventListener","current","focus","removeEventListener","styles","tabIndex","onClick","href","countries","code","name","dialCode","flag","PhoneInputWithCountryCode","phone","setPhone","phoneError","setPhoneError","showModal","setShowModal","selectedCountry","setSelectedCountry","defaultCountry","locale","Intl","DateTimeFormat","resolvedOptions","countryCode","split","toUpperCase","find","c","getDefaultCountry","onChange","country","target","stripped","replace","newPhone","AsYouType","map","raw","full","formatted","onBlur","parsed","parsePhoneNumberFromString","isValid","autoComplete","placeholder","isValidEmail","email","normalized","trim","length","parts","localPart","domainPart","test","endsWith","isValidPhoneNumber","phoneNumber","isPasskeySupported","window","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","AuthFallbackOptions","identifier","onMagicLink","onPhoneOtp","onPasskeyRetry","showMagicLink","showPhoneOtp","Login","navigate","useNavigate","setIdentifier","setEmail","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","passkeyAvailable","setPasskeyAvailable","showFallbackOptions","setShowFallbackOptions","supported","checkSupport","handlePasskeyLogin","options","startAuthentication","optionsJSON","verificationResponse","assertionResponse","verificationResult","message","mfaLogin","_Fragment","onSubmit","preventDefault","err","login","register","htmlFor","required","disabled","PassKeyLogin","DeviceNameModal","onCancel","onConfirm","setValue","autoFocus","PasskeyRegistration","setStatus","setMessage","showDeviceModal","setShowDeviceModal","pendingMetadata","setPendingMetadata","verifyPassKey","attResp","metadata","attestationResponse","platform","browser","deviceInfo","ua","navigator","userAgent","toLowerCase","parseUserAgent","challengeRes","startRegistration","WebAuthnError","OtpInput","inputs","values","concat","Array","fill","slice","onPaste","pasted","clipboardData","getData","digit","i","el","inputMode","maxLength","index","char","newValue","substring","handleChange","onKeyDown","PhoneRegistration","phoneOtp","setPhoneOtp","phoneVerified","setPhoneVerified","setError","resendMsg","setResendMsg","phoneTimeLeft","setPhoneTimeLeft","verifyPhoneOTP","verificationToken","handleResend","data","onResendPhone","interval","setInterval","prev","clearInterval","nextStep","verified","seconds","Math","floor","toString","padStart","EmailRegistration","emailOtp","setEmailOtp","emailTimeLeft","setEmailTimeLeft","VerifyMagicLink","searchParams","useSearchParams","get","successMsg","setSuccessMsg","BroadcastChannel","postMessage","setTimeout","verify","container","card","title","verificationContent","spinner","successIcon","viewBox","checkIcon","stroke","strokeWidth","d","helperText","successText","MagicLinkSent","location","useLocation","state","cooldown","setCooldown","timer","channel","onmessage","event","close","AuthRoutes","Routes","Route","path","element","Navigate","to"],"mappings":"meAOA,MAAMA,EAAsBC,OAAmDC,GAElEC,EAAuB,EAClCC,QACAC,cAMEC,EAACN,EAAoBO,SAAQ,CAACH,MAAOA,EAAKC,SAAGA,IAKpCG,EAAkB,KAC7B,MAAMC,EAAUC,EAAWV,GAC3B,IAAKS,EACH,MAAM,IAAIE,MAAM,4DAElB,OAAOF,GCpBIG,EAAuBC,IAClC,MAAMC,SAAEA,EAAQC,SAAEA,GAAaF,EAE/B,OAAOG,eACLC,EACAC,GAEA,MAEMC,EAAM,GAAGJ,IAFW,WAAbD,EAAwB,OAAS,KAEbG,EAAMG,WAAW,KAAOH,EAAQ,IAAIA,MAE/DI,EAA2B,IAC5BH,EACHI,YAAa,UACbC,QAAS,CACP,eAAgB,sBACbL,GAAMK,UAIPC,QAAiBC,MAAMN,EAAKE,GAElC,GAAIG,EAASE,GAAI,OAAOF,EAGxB,MADAG,QAAQC,KAAK,qBAAsBJ,EAASK,OAAQV,GAC9C,IAAIR,MAAM,8BAA8BQ,IAChD,GC/BIW,EAA2B,IAE7BxB,EAAA,MAAA,CAAKyB,UAAU,4DAA2D1B,SACxEC,EAAA,MAAA,CAAA,cACc,UACZyB,UAAU,qFCoDlB,MAAMC,EAAc/B,OAA2CC,GAMlD+B,EAAU,KACrB,MAAMxB,EAAUC,EAAWsB,GAC3B,IAAKvB,EACH,MAAM,IAAIE,MAAM,+CAElB,OAAOF,GAUIyB,EAA4C,EACvD7B,WACA8B,UACAC,4BAA2B,EAC3BC,OAAO,UAEP,MAAOC,EAAMC,GAAWC,EAAsB,OACvClB,EAAamB,GAAkBD,E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