@seamless-auth/react 0.0.4-beta.12 → 0.0.4-beta.14
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/README.md +12 -7
- package/dist/AuthProvider.d.ts +4 -1
- package/dist/LoadingSpinner.d.ts +1 -1
- package/dist/Login.d.ts +1 -1
- package/dist/MfaLogin.d.ts +1 -1
- package/dist/PassKeyLogin.d.ts +1 -1
- package/dist/RegisterPassKey.d.ts +1 -1
- package/dist/TermsModal.d.ts +1 -1
- package/dist/VerifyOTP.d.ts +1 -1
- package/dist/context/InternalAuthContext.d.ts +1 -1
- package/dist/hooks/usePreviousSignIn.d.ts +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/utils.d.ts +4 -3
- package/package.json +44 -57
- package/dist/VerifyAccount.d.ts +0 -8
- package/dist/index.es.js +0 -2
- package/dist/index.es.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/@seamless-auth/react)
|
|
2
|
-
|
|
3
1
|
# Seamless Auth React
|
|
4
2
|
|
|
3
|
+
# @seamless-auth/react
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@seamless-auth/react)
|
|
6
|
+
[](https://github.com/fells-code/seamless-auth-react/actions/workflows/release.yml)
|
|
7
|
+
[](https://app.codecov.io/gh/fells-code/seamless-auth-react)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
|
|
5
10
|
A drop-in authentication provider for React applications, designed to handle login, multi-factor authentication, passkeys, and user session validation using your own backend.
|
|
6
11
|
|
|
7
12
|
## Features
|
|
@@ -27,8 +32,8 @@ npm install seamless-auth-react
|
|
|
27
32
|
### 1. Wrap your app with `AuthProvider`
|
|
28
33
|
|
|
29
34
|
```tsx
|
|
30
|
-
import { AuthProvider } from
|
|
31
|
-
import { BrowserRouter } from
|
|
35
|
+
import { AuthProvider } from 'seamless-auth-react';
|
|
36
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
32
37
|
|
|
33
38
|
<BrowserRouter>
|
|
34
39
|
<AuthProvider apiHost="https://your.api/">
|
|
@@ -40,7 +45,7 @@ import { BrowserRouter } from "react-router-dom";
|
|
|
40
45
|
### 2. Use `useAuth()` to access auth state
|
|
41
46
|
|
|
42
47
|
```tsx
|
|
43
|
-
import { useAuth } from
|
|
48
|
+
import { useAuth } from 'seamless-auth-react';
|
|
44
49
|
|
|
45
50
|
const Dashboard = () => {
|
|
46
51
|
const { user, logout } = useAuth();
|
|
@@ -56,8 +61,8 @@ const Dashboard = () => {
|
|
|
56
61
|
### 3. Use `<AuthRoutes />` for handling login/mfa/passkey screens
|
|
57
62
|
|
|
58
63
|
```tsx
|
|
59
|
-
import { Routes, Route } from
|
|
60
|
-
import { useAuth, AuthRoutes } from
|
|
64
|
+
import { Routes, Route } from 'react-router-dom';
|
|
65
|
+
import { useAuth, AuthRoutes } from 'seamless-auth-react';
|
|
61
66
|
|
|
62
67
|
const AppRoutes = () => {
|
|
63
68
|
const { isAuthenticated } = useAuth();
|
package/dist/AuthProvider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
interface User {
|
|
3
3
|
id: string;
|
|
4
4
|
email: string;
|
|
@@ -17,6 +17,8 @@ export interface AuthContextType {
|
|
|
17
17
|
hasRole: (role: string) => boolean | undefined;
|
|
18
18
|
apiHost: string;
|
|
19
19
|
token: AuthToken | null;
|
|
20
|
+
markSignedIn: () => void;
|
|
21
|
+
hasSignedInBefore: boolean;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Returns the current context
|
|
@@ -26,6 +28,7 @@ export declare const useAuth: () => AuthContextType;
|
|
|
26
28
|
interface AuthProviderProps {
|
|
27
29
|
children: ReactNode;
|
|
28
30
|
apiHost: string;
|
|
31
|
+
autoDetectPreviousSignin?: boolean;
|
|
29
32
|
}
|
|
30
33
|
export declare const AuthProvider: React.FC<AuthProviderProps>;
|
|
31
34
|
export {};
|
package/dist/LoadingSpinner.d.ts
CHANGED
package/dist/Login.d.ts
CHANGED
package/dist/MfaLogin.d.ts
CHANGED
package/dist/PassKeyLogin.d.ts
CHANGED
package/dist/TermsModal.d.ts
CHANGED
package/dist/VerifyOTP.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthContextType, AuthProvider, useAuth } from
|
|
2
|
-
import { AuthRoutes } from
|
|
1
|
+
import { AuthContextType, AuthProvider, useAuth } from '@/AuthProvider';
|
|
2
|
+
import { AuthRoutes } from '@/AuthRoutes';
|
|
3
3
|
export { AuthProvider, AuthRoutes, useAuth };
|
|
4
4
|
export type { AuthContextType };
|
package/dist/index.js
ADDED
|
@@ -0,0 +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};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,M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AAA,CACEiD,EAAA,QAAA,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]}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* isValidEmail
|
|
3
3
|
*
|
|
4
|
-
* Determine if
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
4
|
+
* Determine if value is a valid email
|
|
5
|
+
*
|
|
6
|
+
* @param email - The email address to validate
|
|
7
|
+
* @returns boolean - Whether the email is syntactically valid
|
|
7
8
|
*/
|
|
8
9
|
export declare const isValidEmail: (email: string) => boolean;
|
|
9
10
|
/**
|
package/package.json
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamless-auth/react",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
4
|
-
"description": "A drop
|
|
5
|
-
"module": "dist/index.es.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "0.0.4-beta.14",
|
|
4
|
+
"description": "A drop-in authentication solution for modern React applications.",
|
|
7
5
|
"type": "module",
|
|
8
6
|
"exports": {
|
|
9
7
|
".": {
|
|
10
|
-
"import": "./dist/index.
|
|
8
|
+
"import": "./dist/index.js",
|
|
11
9
|
"types": "./dist/index.d.ts"
|
|
12
10
|
}
|
|
13
11
|
},
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
14
13
|
"files": [
|
|
15
14
|
"dist",
|
|
16
15
|
"README.md",
|
|
17
16
|
"LICENSE"
|
|
18
17
|
],
|
|
19
18
|
"engines": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"node": ">=20.0.0 <25.0.0",
|
|
20
|
+
"npm": ">=9.0.0 <13.0.0"
|
|
22
21
|
},
|
|
23
22
|
"scripts": {
|
|
23
|
+
"build": "rollup -c",
|
|
24
24
|
"test": "jest",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"prepare": "
|
|
25
|
+
"lint": "eslint ./src",
|
|
26
|
+
"format": "prettier --write .",
|
|
27
|
+
"prepare": "husky",
|
|
28
|
+
"semantic-release": "semantic-release",
|
|
28
29
|
"check-npm-build": "npm pack --dry-run",
|
|
29
|
-
"lint": "
|
|
30
|
+
"lint-staged": "lint-staged"
|
|
31
|
+
},
|
|
32
|
+
"lint-staged": {
|
|
33
|
+
"*.{js,jsx,ts,tsx}": [
|
|
34
|
+
"eslint --fix",
|
|
35
|
+
"prettier --write"
|
|
36
|
+
],
|
|
37
|
+
"*.{json,md,yml,yaml}": [
|
|
38
|
+
"prettier --write"
|
|
39
|
+
]
|
|
30
40
|
},
|
|
31
41
|
"repository": {
|
|
32
42
|
"type": "git",
|
|
33
|
-
"url": "
|
|
43
|
+
"url": "https://github.com/fells-code/seamless-auth-react.git"
|
|
34
44
|
},
|
|
35
45
|
"author": "Brandon Corbett <brandon.corbett@fellscode.com>",
|
|
36
46
|
"license": "ISC",
|
|
@@ -44,67 +54,44 @@
|
|
|
44
54
|
"react-router-dom": "^6.4.0 || ^7.0.0"
|
|
45
55
|
},
|
|
46
56
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@babel/plugin-transform-runtime": "^7.27.1",
|
|
50
|
-
"@babel/preset-env": "^7.25.4",
|
|
51
|
-
"@babel/preset-react": "^7.24.7",
|
|
52
|
-
"@babel/preset-typescript": "^7.27.1",
|
|
57
|
+
"@commitlint/cli": "^20.1.0",
|
|
58
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
53
59
|
"@eslint/js": "^9.17.0",
|
|
54
|
-
"@rollup/plugin-
|
|
60
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
55
61
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
56
62
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
57
63
|
"@rollup/plugin-terser": "^0.4.4",
|
|
58
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
64
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
65
|
-
"@testing-library/react": "^16.0.1",
|
|
66
|
-
"@types/jest": "^29.5.12",
|
|
65
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
66
|
+
"@testing-library/react": "^16.3.0",
|
|
67
|
+
"@testing-library/user-event": "^14.6.1",
|
|
68
|
+
"@types/jest": "^29.5.14",
|
|
67
69
|
"@types/react": "^18.3.4",
|
|
68
70
|
"@types/react-dom": "^18.3.0",
|
|
69
|
-
"
|
|
70
|
-
"eslint": "^
|
|
71
|
-
"eslint-plugin-import": "^2.
|
|
72
|
-
"eslint-plugin-
|
|
73
|
-
"eslint-plugin-react": "^
|
|
71
|
+
"eslint": "^9.38.0",
|
|
72
|
+
"eslint-config-prettier": "^10.1.8",
|
|
73
|
+
"eslint-plugin-import": "^2.32.0",
|
|
74
|
+
"eslint-plugin-react": "^7.37.5",
|
|
75
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
76
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
74
77
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
75
|
-
"
|
|
78
|
+
"husky": "^9.1.7",
|
|
76
79
|
"identity-obj-proxy": "^3.0.0",
|
|
77
80
|
"jest": "^29.7.0",
|
|
78
|
-
"jest-environment-jsdom": "^
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"postcss-modules": "^6.0.1",
|
|
82
|
-
"postcss-url": "^10.1.3",
|
|
83
|
-
"react": "^18.3.1",
|
|
84
|
-
"react-dom": "^18.3.1",
|
|
85
|
-
"rimraf": "^6.0.1",
|
|
86
|
-
"rollup": "^4.0.0",
|
|
81
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
82
|
+
"lint-staged": "^16.2.5",
|
|
83
|
+
"prettier": "^3.6.2",
|
|
87
84
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
88
85
|
"rollup-plugin-postcss": "^4.0.2",
|
|
89
|
-
"
|
|
90
|
-
"ts-jest": "^29.2.5",
|
|
91
|
-
"ts-node": "^10.9.2",
|
|
86
|
+
"ts-jest": "^29.4.5",
|
|
92
87
|
"tslib": "^2.7.0",
|
|
93
|
-
"typescript": "^5.
|
|
94
|
-
"typescript-eslint": "^8.
|
|
88
|
+
"typescript": "^5.9.3",
|
|
89
|
+
"typescript-eslint": "^8.46.1"
|
|
95
90
|
},
|
|
96
91
|
"dependencies": {
|
|
97
|
-
"@babel/runtime": "^7.27.1",
|
|
98
92
|
"@simplewebauthn/browser": "^13.1.0",
|
|
99
93
|
"libphonenumber-js": "^1.12.7",
|
|
100
|
-
"
|
|
94
|
+
"ts-node": "^10.9.2"
|
|
101
95
|
},
|
|
102
|
-
"sideEffects":
|
|
103
|
-
"typesVersions": {
|
|
104
|
-
"*": {
|
|
105
|
-
"*": [
|
|
106
|
-
"dist/index.d.ts"
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
}
|
|
96
|
+
"sideEffects": false
|
|
110
97
|
}
|
package/dist/VerifyAccount.d.ts
DELETED