@seamless-auth/react 0.0.4-beta.15 → 0.0.4-beta.16
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/AuthProvider.d.ts +3 -0
- package/dist/fetchWithAuth.d.ts +8 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/AuthProvider.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { AuthMode } from './fetchWithAuth';
|
|
2
3
|
interface User {
|
|
3
4
|
id: string;
|
|
4
5
|
email: string;
|
|
@@ -19,6 +20,7 @@ export interface AuthContextType {
|
|
|
19
20
|
token: AuthToken | null;
|
|
20
21
|
markSignedIn: () => void;
|
|
21
22
|
hasSignedInBefore: boolean;
|
|
23
|
+
mode: AuthMode;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* Returns the current context
|
|
@@ -29,6 +31,7 @@ interface AuthProviderProps {
|
|
|
29
31
|
children: ReactNode;
|
|
30
32
|
apiHost: string;
|
|
31
33
|
autoDetectPreviousSignin?: boolean;
|
|
34
|
+
mode?: AuthMode;
|
|
32
35
|
}
|
|
33
36
|
export declare const AuthProvider: React.FC<AuthProviderProps>;
|
|
34
37
|
export {};
|
package/dist/fetchWithAuth.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type AuthMode = 'web' | 'server';
|
|
2
|
+
interface FetchWithAuthOptions {
|
|
3
|
+
authMode: AuthMode;
|
|
4
|
+
apiHost?: string;
|
|
5
|
+
authHost?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const createFetchWithAuth: (opts: FetchWithAuthOptions) => (input: string, init?: RequestInit) => Promise<Response>;
|
|
8
|
+
export {};
|
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}),k=()=>{const e=t(b);if(!e)throw new Error("useInternalAuth must be used within InternalAuthProvider");return e},w=async(e,o)=>{const r={...o,credentials:"include",headers:{...o?.headers||{}}},n=await fetch(e,r);if(n.ok)return n;throw new Error("Failed to make API call to auth server.")},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},S=({children:r,apiHost:n,autoDetectPreviousSignin:t=!0})=>{const[s,d]=i(null),[c,_]=i(!1),[m,u]=i(!0),[g,p]=i(null),{hasSignedInBefore:h,markSignedIn:f}=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{}}}}(),y=l(async()=>{if(s)try{await fetch(`${n}auth/logout`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})}catch{console.error("Error during logout")}finally{_(!1),d(null),p(null)}},[n,s]),b=async()=>{try{const e=await w(`${n}users/me`);if(e.ok){const{user:o,token:r}=await e.json();d(o),_(!0),p(r)}else y()}catch{y()}finally{u(!1)}};return a(()=>{b()},[]),a(()=>{s&&c&&f()},[s,c]),m?o("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:[e(x,{}),";"]}):e(P.Provider,{value:{user:s,logout:y,deleteUser:async()=>{try{if((await w(`${n}users/delete`,{method:"delete",credentials:"include"})).ok)return d(null),_(!1),void p(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:c,hasRole:e=>s?.roles?.includes(e),apiHost:n,token:g,markSignedIn:f,hasSignedInBefore:!!t&&h},children:e(v,{value:{validateToken:b,setLoading:u},children:r})})};function C(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",L="login-module__heading___neEqb",j="login-module__message___qSejT",I="login-module__inputGroup___P6qgS",E="login-module__label___mx5vu",A="login-module__input___U07lW",M="login-module__helperText___kDQ4-",F="login-module__error___40zxh",$="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",z="login-module__phoneInput___2MPQC";C(".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 R="termsModal-module__overlay___-j6r5",U="termsModal-module__modal___4PxZV",D="termsModal-module__header___B7wxb",K="termsModal-module__title___Sucwt",J="termsModal-module__closeBtn___evIs5",W="termsModal-module__content___5BDhN",Z="termsModal-module__link___oPZrU";C(".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 H=({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:R,role:"dialog","aria-modal":"true","aria-labelledby":"terms-title",children:o("div",{className:U,tabIndex:-1,ref:t,children:[o("div",{className:D,children:[e("h2",{id:"terms-title",className:K,children:"SMS Terms & Conditions"}),e("button",{onClick:n,className:J,children:"×"})]}),o("div",{className:W,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:"})," Standard carrier 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:Z,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 Y({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:z})]}),o("p",{className:M,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(H,{isOpen:s,onClose:()=>d(!1)})]})}const X=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}=N(),{validateToken:s}=k(),[c,_]=i(""),[m,g]=i(""),[p,h]=i("register"),[f,y]=i(""),[b,v]=i(""),[w,x]=i(""),[P,S]=i(""),[C,G]=i(""),[V,q]=i(!1);a(()=>{!async function(){const e=await oe();q(e)}(),l&&h("login")},[l]);const z=async()=>{v("");try{if(!(await fetch(`${t}auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:c,passkeyAvailable:V}),credentials:"include"})).ok)return void v("Failed to send login link. Please try again.");await(async()=>{try{const e=await fetch(`${t}webAuthn/generate-authentication-options`,{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(),r=await u({optionsJSON:o}),i=await fetch(`${t}webAuthn/verify-authentication`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:r}),credentials:"include"});i.ok||console.error("Failed to verify passkey");const a=await i.json();if("Success"===a.message){if(a.token)return await s(),void n("/");n("/mfaLogin")}else console.error("Passkey login failed:",a.message)}catch(e){console.error("Passkey login error:",e)}})()}catch(e){console.error("Unexpected login error",e),v("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:L,children:"login"===p?"Sign In":"Create Account"}),V?e(r,{children:o("form",{onSubmit:async e=>{e.preventDefault(),"login"===p&&z(),"register"===p&&(async()=>{v("");try{const e=await fetch(`${t}registration/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:m,phone:f}),credentials:"include"});if(!e.ok)return void v("Failed to register. Please try again.");"Success"===(await e.json()).message&&n("/verifyOTP"),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"===p&&o("div",{className:I,children:[e("label",{htmlFor:"identifier",className:E,children:"Email Address / Phone Number"}),e("input",{id:"identifier",type:"text",value:c,onChange:e=>{const o=e.target.value;_(o)},autoComplete:"off",placeholder:"Email or Phone Number",className:A,onBlur:()=>{if(c){const e=X(c)||ee(c);G(e?"":"Please enter a valid email or phone number")}},required:!0}),e("p",{className:M,children:"Phone numbers must include a country code e.g. +1"}),C&&e("p",{className:F,children:C})]}),"register"===p&&o(r,{children:[o("div",{className:I,children:[e("label",{htmlFor:"email",className:E,children:"Email Address"}),e("input",{id:"email",type:"email",value:m,onChange:e=>{const o=e.target.value;g(o)},autoComplete:"off",className:A,onBlur:()=>{if(m){const e=X(m);S(e?"":"Please enter a valid email")}},required:!0}),P&&e("p",{className:F,children:P})]}),e(Y,{phone:f,setPhone:y,phoneError:w,setPhoneError:x})]}),e("button",{type:"submit",className:$,disabled:!("login"===p&&c?X(c)||ee(c):X(m)&&ee(f)),children:"login"===p?"Login":"Register"}),b&&e("p",{className:F,children:b}),e("button",{type:"button",onClick:()=>h("login"===p?"register":"login"),className:B,children:"login"===p?"Don't have an account? Create one":"Already have an account? Sign in"})]})}):e("p",{className:j,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";C(".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}=N(),{validateToken:t}=k(),l=d(),[s,c]=i(""),[_,m]=i(""),[u,g]=i(!1),[p,h]=i(""),[f,y]=i(300),[b,v]=i(null),w=async()=>{const e="phone"===b?"otp/verify-login-phone-otp":"otp/verify-login-email-otp";try{if(!(await fetch(`${n}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:s}),credentials:"include"})).ok)return void m("Verification failed.");await t(),l("/")}catch(e){console.error("Error verifying OTP",e),m("Verification failed.")}},x=async e=>{m("");const o="phone"===e?"otp/generate-login-phone-otp":"otp/generate-login-email-otp";(await fetch(`${n}${o}`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})).ok?h(`Verification ${"phone"===e?"SMS":"email"} has been sent.`):m(`Failed to send ${e} code. If this persists, refresh the page and try again.`)};return a(()=>{const e=setInterval(()=>{y(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"}),p&&e("p",{className:ae,children:p}),o("div",{className:le,children:[o("button",{onClick:()=>{v("phone"),x("phone")},className:`${se} ${"phone"===b?de:""}`,children:["Send code to phone: ",e("span",{className:"font-mono",children:"****1234"})]}),o("button",{onClick:()=>{v("email"),x("email")},className:`${se} ${"email"===b?de:""}`,children:["Send code to email: ",e("span",{className:"font-mono",children:"j***@example.com"})]})]}),b&&o(r,{children:[_&&e("p",{className:ge,children:_}),o("label",{htmlFor:"otp",className:ce,children:["Enter the 6-digit code sent to your ",b,". ",e("br",{}),o("span",{className:_e,children:["Code expires in: ",(P=f,`${Math.floor(P/60).toString().padStart(2,"0")}:${(P%60).toString().padStart(2,"0")}`)]})]}),e("input",{id:"otp",type:"text",maxLength:6,className:me,placeholder:"••••••",onChange:e=>c(e.target.value)}),e("button",{onClick:async e=>{e.preventDefault(),m(""),g(!0);try{await w()}catch{m("Unexpected error occurred.")}finally{g(!1)}},className:ue,disabled:!s||s.length<6||u,children:u?"Verifying...":"Verify"})]})]})});var P};var he="passKeyLogin-module__container___IUKxF",fe="passKeyLogin-module__card___2sKM1",ye="passKeyLogin-module__title___HZxvc",be="passKeyLogin-module__button___FvR4I";C(".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}=N(),{validateToken:t}=k();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 fetch(`${n}webAuthn/generate-authentication-options`,{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 u({optionsJSON:o}),a=await fetch(`${n}webAuthn/verify-authentication`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:i}),credentials:"include"});a.ok||console.error("Failed to verify passkey");const l=await a.json();if("Success"===l.message){if(l.token)return await t(),void r("/");r("/mfaLogin")}else console.error("Passkey login failed:",l.message)}catch(e){console.error("Passkey login error:",e)}},className:be,children:"Use Passkey"})]})})};var ke="registerPasskey-module__container___jqEh8",we="registerPasskey-module__card___MJAyC",xe="registerPasskey-module__loading___Q4i1x",Pe="registerPasskey-module__spinner___V1nhd",Ne="registerPasskey-module__supported___ihTih",Se="registerPasskey-module__title___vn2Qu",Ce="registerPasskey-module__description___AWmO-",Te="registerPasskey-module__button___D3b4B",Oe="registerPasskey-module__message___RiOw-",Le="registerPasskey-module__success___HP5aX",je="registerPasskey-module__error___hGiqE";C(".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}");const Ie=()=>{const{apiHost:r}=N(),{validateToken:n}=k(),t=d(),[l,s]=i("idle"),[c,_]=i(""),[m,u]=i(!1),h=async e=>{try{const o=await fetch(`${r}webAuthn/verify-registration`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attestationResponse:e}),credentials:"include"}),t=await o.json();if(!o.ok)return s("error"),void _("Something went wrong registering passkey.");t?.verified&&await n()}catch(e){console.error(`An error occurred: ${e}`)}};return a(()=>{!async function(){const e=await oe();u(e)}()},[]),e("div",{className:ke,children:e("div",{className:we,children:m?m&&o("div",{className:Ne,children:[e("h2",{className:Se,children:"Secure Your Account with a Passkey"}),e("p",{className:Ce,children:"Your device supports passkeys! Register one to skip passwords forever."}),e("button",{onClick:async()=>{s("loading");try{const e=await fetch(`${r}webAuthn/generate-registration-options`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)return s("error"),void _("Something went wrong registering passkey.");const o=await e.json();let n;try{n=await g({optionsJSON:o}),await h(n)}catch(e){return void(e instanceof p?(console.error(`Error occurred with webAuthn, ${e.name} - ${e.code}-${e.stack}`),s("error"),_(`Error: ${e.name}`)):(console.error("A problem happened.",e),s("error"),_(`Error: ${e}`)))}s("success"),_("Passkey registered successfully."),t("/")}catch(e){console.error(e),s("error"),_("Something went wrong registering passkey.")}},disabled:"loading"===l,className:Te,children:"loading"===l?"Registering...":"Register Passkey"}),c&&e("p",{className:`${Oe} ${"success"===l?Le:je}`,children:c})]}):o("div",{className:xe,children:[e("div",{className:Pe}),e("span",{children:"Checking for Passkey Support..."})]})})})};var Ee="verifyOTP-module__container___wgoDE",Ae="verifyOTP-module__card___3cs2p",Me="verifyOTP-module__title___fZ-1d",Fe="verifyOTP-module__subtitle___dGSu3",$e="verifyOTP-module__error___GEtlG",Be="verifyOTP-module__success___46TjG",Ge="verifyOTP-module__form___jiGG-",Ve="verifyOTP-module__label___Zq5Mi",qe="verifyOTP-module__timer___smq-a",ze="verifyOTP-module__input___yqIXM",Re="verifyOTP-module__resend___PlmkG",Ue="verifyOTP-module__button___8pIuO";C(".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}");const De=()=>{const r=d(),{apiHost:n}=N(),[t,l]=i(""),[s,c]=i(""),[_,m]=i(null),[u,g]=i(null),[p,h]=i(""),[f,y]=i(!1),[b,v]=i(""),[k,w]=i(300),[x,P]=i(300),S=async()=>{y(!0);try{if(!_){(await fetch(`${n}otp/verify-phone-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:s}),credentials:"include"})).ok?m(!0):h("Verification failed.")}}catch(e){console.error(e),h("Verification failed.")}y(!1)},C=async()=>{y(!0);try{if(!u){(await fetch(`${n}otp/verify-email-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:t}),credentials:"include"})).ok?g(!0):h("Verification failed.")}}catch(e){console.error(e),h("Verification failed.")}y(!1)},T=e=>{v(""),"email"===e?((async()=>{h("");const e=await fetch(`${n}otp/generate-email-otp`,{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(v("Verification email has been resent."),o.token&&localStorage.setItem("token",o.token)):h("Failed to send Email code. If this persists, refresh the page and try again.")})(),v("Verification email has been resent.")):((async()=>{h("");const e=await fetch(`${n}otp/generate-phone-otp`,{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(o.token&&localStorage.setItem("token",o.token),v("Verification SMS has been resent.")):h("Failed to send SMS code. If this persists, refresh the page and try again.")})(),v("Verification SMS has been resent."))},O=o=>!0===o?e("span",{className:"text-green-400 ml-2",children:"✅"}):!1===o?e("span",{className:"text-red-400 ml-2",children:"❌"}):null,L=e=>`${Math.floor(e/60).toString().padStart(2,"0")}:${(e%60).toString().padStart(2,"0")}`;return a(()=>{const e=setInterval(()=>{w(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{const e=setInterval(()=>{P(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{u&&_&&r("/registerPasskey")},[u,_,r]),e("div",{className:Ee,children:o("div",{className:Ae,children:[e("h2",{className:Me,children:"Verify Your Contact Info"}),e("p",{className:Fe,children:"Enter the codes sent to your email and phone number."}),p&&e("p",{className:$e,children:p}),b&&e("p",{className:Be,children:b}),o("form",{onSubmit:async e=>{if(e.preventDefault(),h(""),6===t.length)if(6===s.length){y(!0);try{C(),S()}catch{h("Unexpected error occurred.")}finally{y(!1)}}else h("Please enter a valid code.");else h("Please enter a valid code.")},className:Ge,children:[o("div",{children:[o("label",{htmlFor:"emailCode",className:Ve,children:["Email Verification Code ",O(u)," -"," ",o("span",{className:qe,children:["Code expires in: ",L(k)]})]}),e("input",{id:"emailCode",type:"text",maxLength:6,value:t,autoComplete:"off",onChange:e=>{l(e.target.value),g(null)},className:ze,required:!0}),e("button",{type:"button",onClick:()=>T("email"),className:Re,children:"Resend code to email"})]}),o("div",{children:[o("label",{htmlFor:"phoneCode",className:Ve,children:["Phone Verification Code ",O(_)," -"," ",o("span",{className:qe,children:["Code expires in: ",L(x)]})]}),e("input",{id:"phoneCode",type:"text",maxLength:6,pattern:"\\d{6}",inputMode:"numeric",value:s,autoComplete:"off",onChange:e=>{c(e.target.value),m(null)},className:ze,required:!0}),e("button",{type:"button",onClick:()=>T("phone"),className:Re,children:"Resend code to phone"})]}),e("button",{type:"submit",className:Ue,children:f?"Verifying...":"Verify & Continue"})]})]})})},Ke=()=>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(De,{})}),e(_,{path:"/registerPasskey",element:e(Ie,{})}),e(_,{path:"*",element:e(m,{to:"/login",replace:!0})})]});export{S as AuthProvider,Ke as AuthRoutes,N as useAuth};
|
|
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 s,useRef as l}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}),k=()=>{const e=t(b);if(!e)throw new Error("useInternalAuth must be used within InternalAuthProvider");return e},w=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:{...n?.headers||{}}},a=await fetch(t,i);if(a.ok)return a;throw console.error("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},S=({children:r,apiHost:n,autoDetectPreviousSignin:t=!0,mode:l="web"})=>{const[d,c]=i(null),[_,m]=i(!1),[u,g]=i(!0),[p,h]=i(null),{hasSignedInBefore:f,markSignedIn:y}=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{}}}}(),[b]=i(l),k=w({authMode:b,authHost:n}),N=s(async()=>{if(d)try{await k("/logout",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})}catch{console.error("Error during logout")}finally{m(!1),c(null),h(null)}},[k,d]),S=async()=>{try{const e=await k("users/me");if(e.ok){const{user:o,token:r}=await e.json();c(o),m(!0),h(r)}else N()}catch{N()}finally{g(!1)}};return a(()=>{S()},[]),a(()=>{d&&_&&y()},[d,_,y]),u?o("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:[e(x,{}),";"]}):e(P.Provider,{value:{user:d,logout:N,deleteUser:async()=>{try{if((await k("/users/delete",{method:"delete",credentials:"include"})).ok)return c(null),m(!1),void h(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:_,hasRole:e=>d?.roles?.includes(e),apiHost:n,token:p,markSignedIn:y,hasSignedInBefore:!!t&&f,mode:l},children:e(v,{value:{validateToken:S,setLoading:g},children:r})})};function C(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",L="login-module__heading___neEqb",M="login-module__message___qSejT",I="login-module__inputGroup___P6qgS",j="login-module__label___mx5vu",E="login-module__input___U07lW",A="login-module__helperText___kDQ4-",F="login-module__error___40zxh",z="login-module__button___0kFBs",B="login-module__toggle___1JiG1",V="login-module__underline___gs-RS",G="login-module__phoneRow___oeNtq",$="login-module__select___rRV1O",q="login-module__phoneInput___2MPQC";C(".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 R="termsModal-module__overlay___-j6r5",U="termsModal-module__modal___4PxZV",D="termsModal-module__header___B7wxb",K="termsModal-module__title___Sucwt",W="termsModal-module__closeBtn___evIs5",H="termsModal-module__content___5BDhN",J="termsModal-module__link___oPZrU";C(".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=l(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:R,role:"dialog","aria-modal":"true","aria-labelledby":"terms-title",children:o("div",{className:U,tabIndex:-1,ref:t,children:[o("div",{className:D,children:[e("h2",{id:"terms-title",className:K,children:"SMS Terms & Conditions"}),e("button",{onClick:n,className:W,children:"×"})]}),o("div",{className:H,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:"})," Standard carrier 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:J,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 Y({phone:r,setPhone:n,phoneError:t,setPhoneError:s}){const[l,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:j,children:"Phone Number"}),o("div",{className:G,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:$,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&&s("")},onBlur:()=>{if(r){const e=y(r),o=e?.isValid();s(o?"":"Please enter a valid phone number.")}},autoComplete:"off",placeholder:"(555) 123-4567",className:q})]}),o("p",{className:A,children:["By signing up, you agree to our"," ",e("button",{onClick:()=>d(!0),className:V,children:"SMS Terms & Conditions"}),"."]}),t&&e("p",{className:F,children:t}),e(Z,{isOpen:l,onClose:()=>d(!1)})]})}const X=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:s,mode:l}=N(),{validateToken:c}=k(),[_,m]=i(""),[g,p]=i(""),[h,f]=i("register"),[y,b]=i(""),[v,x]=i(""),[P,S]=i(""),[C,V]=i(""),[G,$]=i(""),[q,R]=i(!1),U=w({authMode:l,authHost:t});a(()=>{!async function(){const e=await oe();R(e)}(),s&&f("login")},[s]);const D=async()=>{x("");try{if(!(await U("/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:_,passkeyAvailable:q}),credentials:"include"})).ok)return void x("Failed to send login link. Please try again.");await(async()=>{try{const e=await U("/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(),r=await u({optionsJSON:o}),t=await U("/webAuthn/login/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:r}),credentials:"include"});t.ok||console.error("Failed to verify passkey");const i=await t.json();if("Success"===i.message){if(i.token)return await c(),void n("/");n("/mfaLogin")}else 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:L,children:"login"===h?"Sign In":"Create Account"}),q?e(r,{children:o("form",{onSubmit:async e=>{e.preventDefault(),"login"===h&&D(),"register"===h&&(async()=>{x("");try{const e=await U("/registration/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:g,phone:y}),credentials:"include"});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:j,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:E,onBlur:()=>{if(_){const e=X(_)||ee(_);$(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"}),G&&e("p",{className:F,children:G})]}),"register"===h&&o(r,{children:[o("div",{className:I,children:[e("label",{htmlFor:"email",className:j,children:"Email Address"}),e("input",{id:"email",type:"email",value:g,onChange:e=>{const o=e.target.value;p(o)},autoComplete:"off",className:E,onBlur:()=>{if(g){const e=X(g);V(e?"":"Please enter a valid email")}},required:!0}),C&&e("p",{className:F,children:C})]}),e(Y,{phone:y,setPhone:b,phoneError:P,setPhoneError:S})]}),e("button",{type:"submit",className:z,disabled:!("login"===h&&_?X(_)||ee(_):X(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:M,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",se="mfaLogin-module__buttonGroup___3Corm",le="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";C(".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:s}=k(),l=d(),[c,_]=i(""),[m,u]=i(""),[g,p]=i(!1),[h,f]=i(""),[y,b]=i(300),[v,x]=i(null),P=w({authMode:t,authHost:n}),S=async()=>{const e="phone"===v?"otp/verify-login-phone-otp":"otp/verify-login-email-otp";try{if(!(await P(`/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:c}),credentials:"include"})).ok)return void u("Verification failed.");await s(),l("/")}catch(e){console.error("Error verifying OTP",e),u("Verification failed.")}},C=async e=>{u("");const o="phone"===e?"otp/generate-login-phone-otp":"otp/generate-login-email-otp";try{(await P(`/${o}`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})).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:se,children:[o("button",{onClick:()=>{x("phone"),C("phone")},className:`${le} ${"phone"===v?de:""}`,children:["Send code to phone: ",e("span",{className:"font-mono",children:"****1234"})]}),o("button",{onClick:()=>{x("email"),C("email")},className:`${le} ${"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 S()}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";C(".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}=k(),a=w({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 s=await t.json();if("Success"===s.message){if(s.token)return await i(),void r("/");r("/mfaLogin")}else console.error("Passkey login failed")}catch{console.error("Passkey login error")}},className:be,children:"Use Passkey"})]})})};var ke="registerPasskey-module__container___jqEh8",we="registerPasskey-module__card___MJAyC",xe="registerPasskey-module__loading___Q4i1x",Pe="registerPasskey-module__spinner___V1nhd",Ne="registerPasskey-module__supported___ihTih",Se="registerPasskey-module__title___vn2Qu",Ce="registerPasskey-module__description___AWmO-",Te="registerPasskey-module__button___D3b4B",Oe="registerPasskey-module__message___RiOw-",Le="registerPasskey-module__success___HP5aX",Me="registerPasskey-module__error___hGiqE";C(".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}");const Ie=()=>{const{apiHost:r,mode:n}=N(),{validateToken:t}=k(),s=d(),[l,c]=i("idle"),[_,m]=i(""),[u,h]=i(!1),f=w({authMode:n,authHost:r}),y=async e=>{try{const o=await f("/webAuthn/register/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attestationResponse:e}),credentials:"include"}),r=await o.json();if(!o.ok)return c("error"),void m("Something went wrong registering passkey.");r?.verified&&await t()}catch(e){console.error(`An error occurred: ${e}`)}};return a(()=>{!async function(){const e=await oe();h(e)}()},[]),e("div",{className:ke,children:e("div",{className:we,children:u?u&&o("div",{className:Ne,children:[e("h2",{className:Se,children:"Secure Your Account with a Passkey"}),e("p",{className:Ce,children:"Your device supports passkeys! Register one to skip passwords forever."}),e("button",{onClick:async()=>{c("loading");try{const e=await f("/webAuthn/register/start",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)return c("error"),void m("Something went wrong registering passkey.");const o=await e.json();let r;try{r=await g({optionsJSON:o}),await y(r)}catch(e){return void(e instanceof p?(console.error(`Error occurred with webAuthn, ${e.name} - ${e.code}-${e.stack}`),c("error"),m(`Error: ${e.name}`)):(console.error("A problem happened.",e),c("error"),m(`Error: ${e}`)))}c("success"),m("Passkey registered successfully."),s("/")}catch(e){console.error(e),c("error"),m("Something went wrong registering passkey.")}},disabled:"loading"===l,className:Te,children:"loading"===l?"Registering...":"Register Passkey"}),_&&e("p",{className:`${Oe} ${"success"===l?Le:Me}`,children:_})]}):o("div",{className:xe,children:[e("div",{className:Pe}),e("span",{children:"Checking for Passkey Support..."})]})})})};var je="verifyOTP-module__container___wgoDE",Ee="verifyOTP-module__card___3cs2p",Ae="verifyOTP-module__title___fZ-1d",Fe="verifyOTP-module__subtitle___dGSu3",ze="verifyOTP-module__error___GEtlG",Be="verifyOTP-module__success___46TjG",Ve="verifyOTP-module__form___jiGG-",Ge="verifyOTP-module__label___Zq5Mi",$e="verifyOTP-module__timer___smq-a",qe="verifyOTP-module__input___yqIXM",Re="verifyOTP-module__resend___PlmkG",Ue="verifyOTP-module__button___8pIuO",De="verifyOTP-module__toggle___wbzVa";C(".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 Ke=()=>{const r=d(),{apiHost:n,mode:t}=N(),[s,l]=i(""),[c,_]=i(""),[m,u]=i(null),[g,p]=i(null),[h,f]=i(""),[y,b]=i(!1),[v,k]=i(""),[x,P]=i(300),[S,C]=i(300),T=w({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)},L=async()=>{b(!0);try{if(!g){(await T("/otp/verify-email-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:s}),credentials:"include"})).ok?p(!0):f("Verification failed.")}}catch(e){console.error(e),f("Verification failed.")}b(!1)},M=e=>{k(""),"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?(k("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.")})(),k("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),k("Verification SMS has been resent.")):f("Failed to send SMS code. If this persists, refresh the page and try again.")})(),k("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,j=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(()=>{C(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{g&&m&&r("/registerPasskey")},[g,m,r]),e("div",{className:je,children:o("div",{className:Ee,children:[e("h2",{className:Ae,children:"Verify Your Contact Info"}),e("p",{className:Fe,children:"Enter the codes sent to your email and phone number."}),h&&e("p",{className:ze,children:h}),v&&e("p",{className:Be,children:v}),o("form",{onSubmit:async e=>{if(e.preventDefault(),f(""),6===s.length)if(6===c.length){b(!0);try{L(),O()}catch{f("Unexpected error occurred.")}finally{b(!1)}}else f("Please enter a valid code.");else f("Please enter a valid code.")},className:Ve,children:[o("div",{children:[o("label",{htmlFor:"emailCode",className:Ge,children:["Email Verification Code ",I(g)," -"," ",o("span",{className:$e,children:["Code expires in: ",j(x)]})]}),e("input",{id:"emailCode",type:"text",maxLength:6,value:s,autoComplete:"off",onChange:e=>{l(e.target.value),p(null)},className:qe,required:!0}),e("button",{type:"button",onClick:()=>M("email"),className:Re,children:"Resend code to email"})]}),o("div",{children:[o("label",{htmlFor:"phoneCode",className:Ge,children:["Phone Verification Code ",I(m)," -"," ",o("span",{className:$e,children:["Code expires in: ",j(S)]})]}),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:qe,required:!0}),e("button",{type:"button",onClick:()=>M("phone"),className:Re,children:"Resend code to phone"})]}),e("button",{type:"submit",className:Ue,children:y?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>r("/login"),className:De,children:"Back to login"})]})]})})},We=()=>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(Ke,{})}),e(_,{path:"/registerPasskey",element:e(Ie,{})}),e(_,{path:"*",element:e(m,{to:"/login",replace:!0})})]});export{S as AuthProvider,We as AuthRoutes,N 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/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],"names":["InternalAuthContext","createContext","undefined","InternalAuthProvider","value","children","_jsx","Provider","useInternalAuth","context","useContext","Error","fetchWithAuth","async","input","init","requestInit","credentials","headers","response","fetch","ok","LoadingSpinner","className","AuthContext","useAuth","AuthProvider","apiHost","autoDetectPreviousSignin","user","setUser","useState","isAuthenticated","setIsAuthenticated","loading","setLoading","token","setToken","hasSignedInBefore","markSignedIn","storageKey","setHasSignedInBefore","useEffect","localStorage","getItem","setItem","usePreviousSignIn","logout","useCallback","method","console","error","validateToken","json","_jsxs","deleteUser","hasRole","role","roles","includes","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","id","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","startsWith","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","mode","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","passkeyAvailable","setPasskeyAvailable","supported","checkSupport","login","body","JSON","stringify","options","credential","startAuthentication","optionsJSON","verificationResponse","assertionResponse","verificationResult","message","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","RegisterPasskey","status","setStatus","setMessage","verifyPassKey","attResp","verificationResp","attestationResponse","verificationJSON","verified","challengeRes","startRegistration","WebAuthnError","stack","VerifyOTP","emailOtp","setEmailOtp","phoneOtp","setPhoneOtp","phoneVerified","setPhoneVerified","emailVerified","setEmailVerified","emailTimeLeft","setEmailTimeLeft","phoneTimeLeft","setPhoneTimeLeft","verifyPhoneOTP","verifyEmailOTP","handleResend","data","onResendEmail","onResendPhone","getStatusIcon","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,GC3BIG,EAAgBC,MAC3BC,EACAC,KAEA,MAAMC,EAA2B,IAC5BD,EACHE,YAAa,UACbC,QAAS,IACHH,GAAMG,SAAW,KAInBC,QAAiBC,MAAMN,EAAOE,GAEpC,GAAIG,EAASE,GACX,OAAOF,EAGT,MAAM,IAAIR,MAAM,4CChBZW,EAA2B,IAE7BhB,EAAA,MAAA,CAAKiB,UAAU,4DAA2DlB,SACxEC,EAAA,MAAA,CAAA,cACc,UACZ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AAA,CAAOsI,QAAQ,YAAYrK,UAAWiE,GAAYnF,SAAA,CAAA,2BACvBoP,EAAcd,QAAkB,IACzDrL,UAAM/B,UAAWiE,GAAYnF,SAAA,CAAA,oBACTqP,EAAWT,SAGjC3O,EAAA,QAAA,CACEoF,GAAG,YACHrB,KAAK,OACLiJ,UAAW,EACXqC,QAAQ,SACRC,UAAU,UACVxP,MAAOqO,EACPnG,aAAa,MACbhB,SAAUpC,IACRwJ,EAAYxJ,EAAEsC,OAAOpH,OACrBwO,EAAiB,OAEnBrN,UAAWiE,GACXqG,UAAQ,IAEVvL,EAAA,SAAA,CACE+D,KAAK,SACLsB,QAAS,IAAM0J,EAAa,SAC5B9N,UAAWiE,GAAanF,SAAA,4BAM5BC,EAAA,SAAA,CAAQ+D,KAAK,SAAS9C,UAAWiE,GAAanF,SAC3C6B,EAAU,eAAiB,+BCzQ3B2N,GAAa,IACxBvM,EAACwM,EAAM,CAAAzP,SAAA,CACLC,EAACyP,EAAK,CAACC,KAAK,SAASC,QAAS3P,EAACkJ,GAAK,CAAA,KACpClJ,EAACyP,GAAMC,KAAK,gBAAgBC,QAAS3P,EAACiN,GAAY,CAAA,KAClDjN,EAACyP,EAAK,CAACC,KAAK,YAAYC,QAAS3P,EAACyL,GAAQ,CAAA,KAC1CzL,EAACyP,EAAK,CAACC,KAAK,aAAaC,QAAS3P,EAACgO,SACnChO,EAACyP,EAAK,CAACC,KAAK,mBAAmBC,QAAS3P,EAACkN,GAAe,CAAA,KACxDlN,EAACyP,GAAMC,KAAK,IAAIC,QAAS3P,EAAC4P,EAAQ,CAACC,GAAG,SAASzI,SAAO","x_google_ignoreList":[5]}
|
|
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/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],"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","error","status","LoadingSpinner","className","AuthContext","useAuth","AuthProvider","apiHost","autoDetectPreviousSignin","mode","user","setUser","useState","isAuthenticated","setIsAuthenticated","loading","setLoading","token","setToken","hasSignedInBefore","markSignedIn","storageKey","setHasSignedInBefore","useEffect","localStorage","getItem","setItem","usePreviousSignIn","fetchWithAuth","logout","useCallback","method","validateToken","json","_jsxs","deleteUser","hasRole","role","roles","includes","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","id","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","body","JSON","stringify","options","credential","startAuthentication","optionsJSON","verificationResponse","assertionResponse","verificationResult","message","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","RegisterPasskey","setStatus","setMessage","verifyPassKey","attResp","verificationResp","attestationResponse","verificationJSON","verified","challengeRes","startRegistration","WebAuthnError","stack","VerifyOTP","emailOtp","setEmailOtp","phoneOtp","setPhoneOtp","phoneVerified","setPhoneVerified","emailVerified","setEmailVerified","emailTimeLeft","setEmailTimeLeft","phoneTimeLeft","setPhoneTimeLeft","verifyPhoneOTP","verifyEmailOTP","handleResend","data","onResendEmail","onResendPhone","getStatusIcon","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,GCnBIG,EAAuBC,IAClC,MAAMC,SAAEA,EAAQC,SAAEA,GAAaF,EAE/B,OAAOG,eACLC,EACAC,GAEA,MAE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