@seamless-auth/react 0.0.7 → 0.0.10

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/LICENSE CHANGED
@@ -1,79 +1,661 @@
1
- GNU AFFERO GENERAL PUBLIC LICENSE
2
- Version 3, 19 November 2007
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
3
 
4
- Copyright (C) 2007 Free Software Foundation, Inc.
5
- <https://fsf.org/>
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
6
5
  Everyone is permitted to copy and distribute verbatim copies
7
6
  of this license document, but changing it is not allowed.
8
7
 
9
- This license is identical to the GNU General Public License, except that it also
10
- ensures that software running as a network service makes its source code
11
- available to users.
8
+ Preamble
12
9
 
13
- ---
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
14
13
 
15
- TERMS AND CONDITIONS
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ When we speak of free software, we are referring to freedom, not
21
+ price. Our General Public Licenses are designed to make sure that you
22
+ have the freedom to distribute copies of free software (and charge for
23
+ them if you wish), that you receive source code or can get it if you
24
+ want it, that you can change the software or use pieces of it in new
25
+ free programs, and that you know you can do these things.
26
+
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS
16
60
 
17
61
  0. Definitions.
18
62
 
19
- “This License” refers to version 3 of the GNU Affero General Public License.
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+ "Copyright" also means copyright-like laws that apply to other kinds of
66
+ works, such as semiconductor masks.
67
+
68
+ "The Program" refers to any copyrightable work licensed under this
69
+ License. Each licensee is addressed as "you". "Licensees" and
70
+ "recipients" may be individuals or organizations.
71
+
72
+ To "modify" a work means to copy from or adapt all or part of the work
73
+ in a fashion requiring copyright permission, other than the making of an
74
+ exact copy. The resulting work is called a "modified version" of the
75
+ earlier work or a work "based on" the earlier work.
76
+
77
+ A "covered work" means either the unmodified Program or a work based
78
+ on the Program.
79
+
80
+ To "propagate" a work means to do anything with it that, without
81
+ permission, would make you directly or secondarily liable for
82
+ infringement under applicable copyright law, except executing it on a
83
+ computer or modifying a private copy. Propagation includes copying,
84
+ distribution (with or without modification), making available to the
85
+ public, and in some countries other activities as well.
86
+
87
+ To "convey" a work means any kind of propagation that enables other
88
+ parties to make or receive copies. Mere interaction with a user through
89
+ a computer network, with no transfer of a copy, is not conveying.
90
+
91
+ An interactive user interface displays "Appropriate Legal Notices"
92
+ to the extent that it includes a convenient and prominently visible
93
+ feature that (1) displays an appropriate copyright notice, and (2)
94
+ tells the user that there is no warranty for the work (except to the
95
+ extent that warranties are provided), that licensees may convey the
96
+ work under this License, and how to view a copy of this License. If
97
+ the interface presents a list of user commands or options, such as a
98
+ menu, a prominent item in the list meets this criterion.
99
+
100
+ 1. Source Code.
101
+
102
+ The "source code" for a work means the preferred form of the work
103
+ for making modifications to it. "Object code" means any non-source
104
+ form of a work.
105
+
106
+ A "Standard Interface" means an interface that either is an official
107
+ standard defined by a recognized standards body, or, in the case of
108
+ interfaces specified for a particular programming language, one that
109
+ is widely used among developers working in that language.
110
+
111
+ The "System Libraries" of an executable work include anything, other
112
+ than the work as a whole, that (a) is included in the normal form of
113
+ packaging a Major Component, but which is not part of that Major
114
+ Component, and (b) serves only to enable use of the work with that
115
+ Major Component, or to implement a Standard Interface for which an
116
+ implementation is available to the public in source code form. A
117
+ "Major Component", in this context, means a major essential component
118
+ (kernel, window system, and so on) of the specific operating system
119
+ (if any) on which the executable work runs, or a compiler used to
120
+ produce the work, or an object code interpreter used to run it.
121
+
122
+ The "Corresponding Source" for a work in object code form means all
123
+ the source code needed to generate, install, and (for an executable
124
+ work) run the object code and to modify the work, including scripts to
125
+ control those activities. However, it does not include the work's
126
+ System Libraries, or general-purpose tools or generally available free
127
+ programs which are used unmodified in performing those activities but
128
+ which are not part of the work. For example, Corresponding Source
129
+ includes interface definition files associated with source files for
130
+ the work, and the source code for shared libraries and dynamically
131
+ linked subprograms that the work is specifically designed to require,
132
+ such as by intimate data communication or control flow between those
133
+ subprograms and other parts of the work.
134
+
135
+ The Corresponding Source need not include anything that users
136
+ can regenerate automatically from other parts of the Corresponding
137
+ Source.
138
+
139
+ The Corresponding Source for a work in source code form is that
140
+ same work.
141
+
142
+ 2. Basic Permissions.
143
+
144
+ All rights granted under this License are granted for the term of
145
+ copyright on the Program, and are irrevocable provided the stated
146
+ conditions are met. This License explicitly affirms your unlimited
147
+ permission to run the unmodified Program. The output from running a
148
+ covered work is covered by this License only if the output, given its
149
+ content, constitutes a covered work. This License acknowledges your
150
+ rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+ You may make, run and propagate covered works that you do not
153
+ convey, without conditions so long as your license otherwise remains
154
+ in force. You may convey covered works to others for the sole purpose
155
+ of having them make modifications exclusively for you, or provide you
156
+ with facilities for running those works, provided that you comply with
157
+ the terms of this License in conveying all material for which you do
158
+ not control copyright. Those thus making or running the covered works
159
+ for you must do so exclusively on your behalf, under your direction
160
+ and control, on terms that prohibit them from making any copies of
161
+ your copyrighted material outside their relationship with you.
162
+
163
+ Conveying under any other circumstances is permitted solely under
164
+ the conditions stated below. Sublicensing is not allowed; section 10
165
+ makes it unnecessary.
166
+
167
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+ No covered work shall be deemed part of an effective technological
170
+ measure under any applicable law fulfilling obligations under article
171
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+ similar laws prohibiting or restricting circumvention of such
173
+ measures.
174
+
175
+ When you convey a covered work, you waive any legal power to forbid
176
+ circumvention of technological measures to the extent such circumvention
177
+ is effected by exercising rights under this License with respect to
178
+ the covered work, and you disclaim any intention to limit operation or
179
+ modification of the work as a means of enforcing, against the work's
180
+ users, your or third parties' legal rights to forbid circumvention of
181
+ technological measures.
182
+
183
+ 4. Conveying Verbatim Copies.
184
+
185
+ You may convey verbatim copies of the Program's source code as you
186
+ receive it, in any medium, provided that you conspicuously and
187
+ appropriately publish on each copy an appropriate copyright notice;
188
+ keep intact all notices stating that this License and any
189
+ non-permissive terms added in accord with section 7 apply to the code;
190
+ keep intact all notices of the absence of any warranty; and give all
191
+ recipients a copy of this License along with the Program.
192
+
193
+ You may charge any price or no price for each copy that you convey,
194
+ and you may offer support or warranty protection for a fee.
195
+
196
+ 5. Conveying Modified Source Versions.
197
+
198
+ You may convey a work based on the Program, or the modifications to
199
+ produce it from the Program, in the form of source code under the
200
+ terms of section 4, provided that you also meet all of these conditions:
201
+
202
+ a) The work must carry prominent notices stating that you modified
203
+ it, and giving a relevant date.
204
+
205
+ b) The work must carry prominent notices stating that it is
206
+ released under this License and any conditions added under section
207
+ 7. This requirement modifies the requirement in section 4 to
208
+ "keep intact all notices".
209
+
210
+ c) You must license the entire work, as a whole, under this
211
+ License to anyone who comes into possession of a copy. This
212
+ License will therefore apply, along with any applicable section 7
213
+ additional terms, to the whole of the work, and all its parts,
214
+ regardless of how they are packaged. This License gives no
215
+ permission to license the work in any other way, but it does not
216
+ invalidate such permission if you have separately received it.
217
+
218
+ d) If the work has interactive user interfaces, each must display
219
+ Appropriate Legal Notices; however, if the Program has interactive
220
+ interfaces that do not display Appropriate Legal Notices, your
221
+ work need not make them do so.
222
+
223
+ A compilation of a covered work with other separate and independent
224
+ works, which are not by their nature extensions of the covered work,
225
+ and which are not combined with it such as to form a larger program,
226
+ in or on a volume of a storage or distribution medium, is called an
227
+ "aggregate" if the compilation and its resulting copyright are not
228
+ used to limit the access or legal rights of the compilation's users
229
+ beyond what the individual works permit. Inclusion of a covered work
230
+ in an aggregate does not cause this License to apply to the other
231
+ parts of the aggregate.
232
+
233
+ 6. Conveying Non-Source Forms.
234
+
235
+ You may convey a covered work in object code form under the terms
236
+ of sections 4 and 5, provided that you also convey the
237
+ machine-readable Corresponding Source under the terms of this License,
238
+ in one of these ways:
239
+
240
+ a) Convey the object code in, or embodied in, a physical product
241
+ (including a physical distribution medium), accompanied by the
242
+ Corresponding Source fixed on a durable physical medium
243
+ customarily used for software interchange.
244
+
245
+ b) Convey the object code in, or embodied in, a physical product
246
+ (including a physical distribution medium), accompanied by a
247
+ written offer, valid for at least three years and valid for as
248
+ long as you offer spare parts or customer support for that product
249
+ model, to give anyone who possesses the object code either (1) a
250
+ copy of the Corresponding Source for all the software in the
251
+ product that is covered by this License, on a durable physical
252
+ medium customarily used for software interchange, for a price no
253
+ more than your reasonable cost of physically performing this
254
+ conveying of source, or (2) access to copy the
255
+ Corresponding Source from a network server at no charge.
256
+
257
+ c) Convey individual copies of the object code with a copy of the
258
+ written offer to provide the Corresponding Source. This
259
+ alternative is allowed only occasionally and noncommercially, and
260
+ only if you received the object code with such an offer, in accord
261
+ with subsection 6b.
262
+
263
+ d) Convey the object code by offering access from a designated
264
+ place (gratis or for a charge), and offer equivalent access to the
265
+ Corresponding Source in the same way through the same place at no
266
+ further charge. You need not require recipients to copy the
267
+ Corresponding Source along with the object code. If the place to
268
+ copy the object code is a network server, the Corresponding Source
269
+ may be on a different server (operated by you or a third party)
270
+ that supports equivalent copying facilities, provided you maintain
271
+ clear directions next to the object code saying where to find the
272
+ Corresponding Source. Regardless of what server hosts the
273
+ Corresponding Source, you remain obligated to ensure that it is
274
+ available for as long as needed to satisfy these requirements.
275
+
276
+ e) Convey the object code using peer-to-peer transmission, provided
277
+ you inform other peers where the object code and Corresponding
278
+ Source of the work are being offered to the general public at no
279
+ charge under subsection 6d.
280
+
281
+ A separable portion of the object code, whose source code is excluded
282
+ from the Corresponding Source as a System Library, need not be
283
+ included in conveying the object code work.
284
+
285
+ A "User Product" is either (1) a "consumer product", which means any
286
+ tangible personal property which is normally used for personal, family,
287
+ or household purposes, or (2) anything designed or sold for incorporation
288
+ into a dwelling. In determining whether a product is a consumer product,
289
+ doubtful cases shall be resolved in favor of coverage. For a particular
290
+ product received by a particular user, "normally used" refers to a
291
+ typical or common use of that class of product, regardless of the status
292
+ of the particular user or of the way in which the particular user
293
+ actually uses, or expects or is expected to use, the product. A product
294
+ is a consumer product regardless of whether the product has substantial
295
+ commercial, industrial or non-consumer uses, unless such uses represent
296
+ the only significant mode of use of the product.
297
+
298
+ "Installation Information" for a User Product means any methods,
299
+ procedures, authorization keys, or other information required to install
300
+ and execute modified versions of a covered work in that User Product from
301
+ a modified version of its Corresponding Source. The information must
302
+ suffice to ensure that the continued functioning of the modified object
303
+ code is in no case prevented or interfered with solely because
304
+ modification has been made.
20
305
 
21
- “Copyright” also means copyright-like laws that apply to other kinds of works,
22
- such as semiconductor masks.
306
+ If you convey an object code work under this section in, or with, or
307
+ specifically for use in, a User Product, and the conveying occurs as
308
+ part of a transaction in which the right of possession and use of the
309
+ User Product is transferred to the recipient in perpetuity or for a
310
+ fixed term (regardless of how the transaction is characterized), the
311
+ Corresponding Source conveyed under this section must be accompanied
312
+ by the Installation Information. But this requirement does not apply
313
+ if neither you nor any third party retains the ability to install
314
+ modified object code on the User Product (for example, the work has
315
+ been installed in ROM).
23
316
 
24
- The “Program” refers to any copyrightable work licensed under this License.
25
- Each licensee is addressed as “you”.
317
+ The requirement to provide Installation Information does not include a
318
+ requirement to continue to provide support service, warranty, or updates
319
+ for a work that has been modified or installed by the recipient, or for
320
+ the User Product in which it has been modified or installed. Access to a
321
+ network may be denied when the modification itself materially and
322
+ adversely affects the operation of the network or violates the rules and
323
+ protocols for communication across the network.
26
324
 
27
- To “modify” a work means to copy from or adapt all or part of the work in a
28
- fashion requiring copyright permission, other than the making of an exact copy.
325
+ Corresponding Source conveyed, and Installation Information provided,
326
+ in accord with this section must be in a format that is publicly
327
+ documented (and with an implementation available to the public in
328
+ source code form), and must require no special password or key for
329
+ unpacking, reading or copying.
29
330
 
30
- To “propagate” a work means to do anything with it that, without permission,
31
- would make you directly or secondarily liable for infringement under applicable
32
- copyright law, except executing it on a computer or modifying a private copy.
331
+ 7. Additional Terms.
33
332
 
34
- To “convey” a work means any kind of propagation that enables other parties to
35
- make or receive copies.
333
+ "Additional permissions" are terms that supplement the terms of this
334
+ License by making exceptions from one or more of its conditions.
335
+ Additional permissions that are applicable to the entire Program shall
336
+ be treated as though they were included in this License, to the extent
337
+ that they are valid under applicable law. If additional permissions
338
+ apply only to part of the Program, that part may be used separately
339
+ under those permissions, but the entire Program remains governed by
340
+ this License without regard to the additional permissions.
36
341
 
37
- An interactive user interface displays “Appropriate Legal Notices” to the extent
38
- that it includes a convenient and prominently visible feature that displays an
39
- appropriate copyright notice, and tells the user that there is no warranty for
40
- the work (except to the extent that warranties are provided), that licensees may
41
- convey the work under this License, and how to view a copy of this License.
342
+ When you convey a copy of a covered work, you may at your option
343
+ remove any additional permissions from that copy, or from any part of
344
+ it. (Additional permissions may be written to require their own
345
+ removal in certain cases when you modify the work.) You may place
346
+ additional permissions on material, added by you to a covered work,
347
+ for which you have or can give appropriate copyright permission.
42
348
 
43
- ---
349
+ Notwithstanding any other provision of this License, for material you
350
+ add to a covered work, you may (if authorized by the copyright holders of
351
+ that material) supplement the terms of this License with terms:
352
+
353
+ a) Disclaiming warranty or limiting liability differently from the
354
+ terms of sections 15 and 16 of this License; or
355
+
356
+ b) Requiring preservation of specified reasonable legal notices or
357
+ author attributions in that material or in the Appropriate Legal
358
+ Notices displayed by works containing it; or
359
+
360
+ c) Prohibiting misrepresentation of the origin of that material, or
361
+ requiring that modified versions of such material be marked in
362
+ reasonable ways as different from the original version; or
363
+
364
+ d) Limiting the use for publicity purposes of names of licensors or
365
+ authors of the material; or
366
+
367
+ e) Declining to grant rights under trademark law for use of some
368
+ trade names, trademarks, or service marks; or
369
+
370
+ f) Requiring indemnification of licensors and authors of that
371
+ material by anyone who conveys the material (or modified versions of
372
+ it) with contractual assumptions of liability to the recipient, for
373
+ any liability that these contractual assumptions directly impose on
374
+ those licensors and authors.
375
+
376
+ All other non-permissive additional terms are considered "further
377
+ restrictions" within the meaning of section 10. If the Program as you
378
+ received it, or any part of it, contains a notice stating that it is
379
+ governed by this License along with a term that is a further
380
+ restriction, you may remove that term. If a license document contains
381
+ a further restriction but permits relicensing or conveying under this
382
+ License, you may add to a covered work material governed by the terms
383
+ of that license document, provided that the further restriction does
384
+ not survive such relicensing or conveying.
385
+
386
+ If you add terms to a covered work in accord with this section, you
387
+ must place, in the relevant source files, a statement of the
388
+ additional terms that apply to those files, or a notice indicating
389
+ where to find the applicable terms.
390
+
391
+ Additional terms, permissive or non-permissive, may be stated in the
392
+ form of a separately written license, or stated as exceptions;
393
+ the above requirements apply either way.
394
+
395
+ 8. Termination.
396
+
397
+ You may not propagate or modify a covered work except as expressly
398
+ provided under this License. Any attempt otherwise to propagate or
399
+ modify it is void, and will automatically terminate your rights under
400
+ this License (including any patent licenses granted under the third
401
+ paragraph of section 11).
402
+
403
+ However, if you cease all violation of this License, then your
404
+ license from a particular copyright holder is reinstated (a)
405
+ provisionally, unless and until the copyright holder explicitly and
406
+ finally terminates your license, and (b) permanently, if the copyright
407
+ holder fails to notify you of the violation by some reasonable means
408
+ prior to 60 days after the cessation.
409
+
410
+ Moreover, your license from a particular copyright holder is
411
+ reinstated permanently if the copyright holder notifies you of the
412
+ violation by some reasonable means, this is the first time you have
413
+ received notice of violation of this License (for any work) from that
414
+ copyright holder, and you cure the violation prior to 30 days after
415
+ your receipt of the notice.
416
+
417
+ Termination of your rights under this section does not terminate the
418
+ licenses of parties who have received copies or rights from you under
419
+ this License. If your rights have been terminated and not permanently
420
+ reinstated, you do not qualify to receive new licenses for the same
421
+ material under section 10.
422
+
423
+ 9. Acceptance Not Required for Having Copies.
424
+
425
+ You are not required to accept this License in order to receive or
426
+ run a copy of the Program. Ancillary propagation of a covered work
427
+ occurring solely as a consequence of using peer-to-peer transmission
428
+ to receive a copy likewise does not require acceptance. However,
429
+ nothing other than this License grants you permission to propagate or
430
+ modify any covered work. These actions infringe copyright if you do
431
+ not accept this License. Therefore, by modifying or propagating a
432
+ covered work, you indicate your acceptance of this License to do so.
433
+
434
+ 10. Automatic Licensing of Downstream Recipients.
435
+
436
+ Each time you convey a covered work, the recipient automatically
437
+ receives a license from the original licensors, to run, modify and
438
+ propagate that work, subject to this License. You are not responsible
439
+ for enforcing compliance by third parties with this License.
440
+
441
+ An "entity transaction" is a transaction transferring control of an
442
+ organization, or substantially all assets of one, or subdividing an
443
+ organization, or merging organizations. If propagation of a covered
444
+ work results from an entity transaction, each party to that
445
+ transaction who receives a copy of the work also receives whatever
446
+ licenses to the work the party's predecessor in interest had or could
447
+ give under the previous paragraph, plus a right to possession of the
448
+ Corresponding Source of the work from the predecessor in interest, if
449
+ the predecessor has it or can get it with reasonable efforts.
450
+
451
+ You may not impose any further restrictions on the exercise of the
452
+ rights granted or affirmed under this License. For example, you may
453
+ not impose a license fee, royalty, or other charge for exercise of
454
+ rights granted under this License, and you may not initiate litigation
455
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
456
+ any patent claim is infringed by making, using, selling, offering for
457
+ sale, or importing the Program or any portion of it.
458
+
459
+ 11. Patents.
460
+
461
+ A "contributor" is a copyright holder who authorizes use under this
462
+ License of the Program or a work on which the Program is based. The
463
+ work thus licensed is called the contributor's "contributor version".
464
+
465
+ A contributor's "essential patent claims" are all patent claims
466
+ owned or controlled by the contributor, whether already acquired or
467
+ hereafter acquired, that would be infringed by some manner, permitted
468
+ by this License, of making, using, or selling its contributor version,
469
+ but do not include claims that would be infringed only as a
470
+ consequence of further modification of the contributor version. For
471
+ purposes of this definition, "control" includes the right to grant
472
+ patent sublicenses in a manner consistent with the requirements of
473
+ this License.
474
+
475
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+ patent license under the contributor's essential patent claims, to
477
+ make, use, sell, offer for sale, import and otherwise run, modify and
478
+ propagate the contents of its contributor version.
479
+
480
+ In the following three paragraphs, a "patent license" is any express
481
+ agreement or commitment, however denominated, not to enforce a patent
482
+ (such as an express permission to practice a patent or covenant not to
483
+ sue for patent infringement). To "grant" such a patent license to a
484
+ party means to make such an agreement or commitment not to enforce a
485
+ patent against the party.
486
+
487
+ If you convey a covered work, knowingly relying on a patent license,
488
+ and the Corresponding Source of the work is not available for anyone
489
+ to copy, free of charge and under the terms of this License, through a
490
+ publicly available network server or other readily accessible means,
491
+ then you must either (1) cause the Corresponding Source to be so
492
+ available, or (2) arrange to deprive yourself of the benefit of the
493
+ patent license for this particular work, or (3) arrange, in a manner
494
+ consistent with the requirements of this License, to extend the patent
495
+ license to downstream recipients. "Knowingly relying" means you have
496
+ actual knowledge that, but for the patent license, your conveying the
497
+ covered work in a country, or your recipient's use of the covered work
498
+ in a country, would infringe one or more identifiable patents in that
499
+ country that you have reason to believe are valid.
500
+
501
+ If, pursuant to or in connection with a single transaction or
502
+ arrangement, you convey, or propagate by procuring conveyance of, a
503
+ covered work, and grant a patent license to some of the parties
504
+ receiving the covered work authorizing them to use, propagate, modify
505
+ or convey a specific copy of the covered work, then the patent license
506
+ you grant is automatically extended to all recipients of the covered
507
+ work and works based on it.
508
+
509
+ A patent license is "discriminatory" if it does not include within
510
+ the scope of its coverage, prohibits the exercise of, or is
511
+ conditioned on the non-exercise of one or more of the rights that are
512
+ specifically granted under this License. You may not convey a covered
513
+ work if you are a party to an arrangement with a third party that is
514
+ in the business of distributing software, under which you make payment
515
+ to the third party based on the extent of your activity of conveying
516
+ the work, and under which the third party grants, to any of the
517
+ parties who would receive the covered work from you, a discriminatory
518
+ patent license (a) in connection with copies of the covered work
519
+ conveyed by you (or copies made from those copies), or (b) primarily
520
+ for and in connection with specific products or compilations that
521
+ contain the covered work, unless you entered into that arrangement,
522
+ or that patent license was granted, prior to 28 March 2007.
523
+
524
+ Nothing in this License shall be construed as excluding or limiting
525
+ any implied license or other defenses to infringement that may
526
+ otherwise be available to you under applicable patent law.
527
+
528
+ 12. No Surrender of Others' Freedom.
529
+
530
+ If conditions are imposed on you (whether by court order, agreement or
531
+ otherwise) that contradict the conditions of this License, they do not
532
+ excuse you from the conditions of this License. If you cannot convey a
533
+ covered work so as to satisfy simultaneously your obligations under this
534
+ License and any other pertinent obligations, then as a consequence you may
535
+ not convey it at all. For example, if you agree to terms that obligate you
536
+ to collect a royalty for further conveying from those to whom you convey
537
+ the Program, the only way you could satisfy both those terms and this
538
+ License would be to refrain entirely from conveying the Program.
44
539
 
45
540
  13. Remote Network Interaction; Use with the GNU General Public License.
46
541
 
47
- Notwithstanding any other provision of this License, if you modify the Program,
48
- your modified version must prominently offer all users interacting with it
49
- remotely through a computer network an opportunity to receive the Corresponding
50
- Source of your version by providing access to the Corresponding Source from a
51
- network server at no charge, through some standard or customary means of
52
- facilitating copying of software.
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
53
552
 
54
- ---
553
+ Notwithstanding any other provision of this License, you have
554
+ permission to link or combine any covered work with a work licensed
555
+ under version 3 of the GNU General Public License into a single
556
+ combined work, and to convey the resulting work. The terms of this
557
+ License will continue to apply to the part which is the covered work,
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
55
560
 
56
- 15. Disclaimer of Warranty.
561
+ 14. Revised Versions of this License.
562
+
563
+ The Free Software Foundation may publish revised and/or new versions of
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
566
+ address new problems or concerns.
57
567
 
58
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
59
- EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
60
- PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
61
- EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
568
+ Each version is given a distinguishing version number. If the
569
+ Program specifies that a certain numbered version of the GNU Affero General
570
+ Public License "or any later version" applies to it, you have the
571
+ option of following the terms and conditions either of that numbered
572
+ version or of any later version published by the Free Software
573
+ Foundation. If the Program does not specify a version number of the
574
+ GNU Affero General Public License, you may choose any version ever published
575
+ by the Free Software Foundation.
63
576
 
64
- ---
577
+ If the Program specifies that a proxy can decide which future
578
+ versions of the GNU Affero General Public License can be used, that proxy's
579
+ public statement of acceptance of a version permanently authorizes you
580
+ to choose that version for the Program.
581
+
582
+ Later license versions may give you additional or different
583
+ permissions. However, no additional obligations are imposed on any
584
+ author or copyright holder as a result of your choosing to follow a
585
+ later version.
586
+
587
+ 15. Disclaimer of Warranty.
588
+
589
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
65
597
 
66
598
  16. Limitation of Liability.
67
599
 
68
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
69
- COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
70
- PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
71
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
72
- THE PROGRAM.
600
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+ SUCH DAMAGES.
609
+
610
+ 17. Interpretation of Sections 15 and 16.
611
+
612
+ If the disclaimer of warranty and limitation of liability provided
613
+ above cannot be given local legal effect according to their terms,
614
+ reviewing courts shall apply local law that most closely approximates
615
+ an absolute waiver of all civil liability in connection with the
616
+ Program, unless a warranty or assumption of liability accompanies a
617
+ copy of the Program in return for a fee.
618
+
619
+ END OF TERMS AND CONDITIONS
620
+
621
+ How to Apply These Terms to Your New Programs
622
+
623
+ If you develop a new program, and you want it to be of the greatest
624
+ possible use to the public, the best way to achieve this is to make it
625
+ free software which everyone can redistribute and change under these terms.
626
+
627
+ To do so, attach the following notices to the program. It is safest
628
+ to attach them to the start of each source file to most effectively
629
+ state the exclusion of warranty; and each file should have at least
630
+ the "copyright" line and a pointer to where the full notice is found.
631
+
632
+ <one line to give the program's name and a brief idea of what it does.>
633
+ Copyright (C) <year> <name of author>
634
+
635
+ This program is free software: you can redistribute it and/or modify
636
+ it under the terms of the GNU Affero General Public License as published
637
+ by the Free Software Foundation, either version 3 of the License, or
638
+ (at your option) any later version.
639
+
640
+ This program is distributed in the hope that it will be useful,
641
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
+ GNU Affero General Public License for more details.
644
+
645
+ You should have received a copy of the GNU Affero General Public License
646
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
73
647
 
74
- ---
648
+ Also add information on how to contact you by electronic and paper mail.
75
649
 
76
- END OF TERMS AND CONDITIONS
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
77
657
 
78
- You should have received a copy of the GNU Affero General Public License along
79
- with this program. If not, see <https://www.gnu.org/licenses/>.
658
+ You should also get your employer (if you work as a programmer) or school,
659
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <https://www.gnu.org/licenses/>.
@@ -25,6 +25,7 @@ export interface AuthContextType {
25
25
  credentials: Credential[];
26
26
  updateCredential: (credential: Credential) => Promise<Credential>;
27
27
  deleteCredential: (credentialId: string) => Promise<void>;
28
+ loading: boolean;
28
29
  }
29
30
  export interface Credential {
30
31
  id: string;
@@ -2,7 +2,9 @@ import React from 'react';
2
2
  interface Props {
3
3
  length?: number;
4
4
  value: string;
5
+ inputMode?: 'numeric' | 'text';
5
6
  onChange: (value: string) => void;
7
+ name?: string;
6
8
  }
7
9
  declare const OtpInput: React.FC<Props>;
8
10
  export default OtpInput;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{createContext as i,useContext as r,useState as t,useEffect as a,useCallback as l,useRef as s}from"react";import{useNavigate as d,useSearchParams as c,useLocation as _,Routes as m,Route as u,Navigate as g}from"react-router-dom";import{startAuthentication as p,startRegistration as h,WebAuthnError as f}from"@simplewebauthn/browser";import y,{AsYouType as b,parsePhoneNumberFromString as k}from"libphonenumber-js";const v=i(void 0),x=({value:o,children:n})=>e(v.Provider,{value:o,children:n}),w=()=>{const e=r(v);if(!e)throw new Error("useInternalAuth must be used within InternalAuthProvider");return e},N=e=>{const{authMode:o,authHost:n}=e;return async function(e,i){const r=`${n}${"server"===o?"auth":""}${e.startsWith("/")?e:`/${e}`}`,t={...i,credentials:"include",headers:{"Content-Type":"application/json",...i?.headers}},a=await fetch(r,t);if(a.ok)return a;throw console.warn("Auth fetch failed:",a.status,r),new Error(`Failed to make API call to ${r}`)}},P=()=>e("div",{className:"flex items-center justify-center min-h-screen bg-gray-900",children:e("div",{"data-testid":"loading",className:"w-12 h-12 border-4 border-gray-600 border-t-blue-500 rounded-full animate-spin"})});const C=i(void 0),T=()=>{const e=r(C);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},M=({children:n,apiHost:i,autoDetectPreviousSignin:r=!0,mode:s="web"})=>{const[d,c]=t(null),[_,m]=t([]),[u,g]=t(!1),[p,h]=t(!0),[f,y]=t(null),{hasSignedInBefore:b,markSignedIn:k}=function(e="seamlessauth_seen"){const[o,n]=t(!1);return a(()=>{try{"true"===localStorage.getItem(e)&&n(!0)}catch{}},[e]),{hasSignedInBefore:o,markSignedIn:()=>{try{localStorage.setItem(e,"true"),n(!0)}catch{}}}}(),[v]=t(s),w=N({authMode:v,authHost:i}),T=l(async()=>{if(d)try{await w("/logout",{method:"GET"})}catch{console.error("Error during logout")}finally{g(!1),c(null),y(null)}},[w,d]),M=async()=>{try{const e=await w("users/me",{method:"GET"});if(e.ok){const{user:o,credentials:n}=await e.json();c(o),m(n),g(!0)}else T()}catch{T()}finally{h(!1)}};return a(()=>{M()},[]),a(()=>{d&&u&&k()},[d,u,k]),p?o("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:[e(P,{}),";"]}):e(C.Provider,{value:{user:d,logout:T,deleteUser:async()=>{try{if((await w("/users/delete",{method:"delete"})).ok)return c(null),g(!1),void y(null);throw new Error("Could not delete user.")}catch(e){throw console.error("Something went wrong deleting user:",e),new Error("Could not delete user.")}},isAuthenticated:u,hasRole:e=>d?.roles?.includes(e),apiHost:i,token:f,markSignedIn:k,hasSignedInBefore:!!r&&b,mode:s,credentials:_,updateCredential:async e=>{const o=await w("users/credentials",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({friendlyName:e.friendlyName,id:e.id})});if(o.ok)return o.json();throw new Error("Failed to update credential")},deleteCredential:async e=>{const o=await w("users/credentials",{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(o.ok)return o.json();throw new Error("Failed to update credential")}},children:e(x,{value:{validateToken:M,setLoading:h},children:n})})};function S(e,o){void 0===o&&(o={});var n=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var I="login-module__container___YggDx",O="login-module__card___Ub-Py",E="login-module__heading___neEqb",j="login-module__inputGroup___P6qgS",A="login-module__label___mx5vu",B="login-module__input___U07lW",z="login-module__helperText___kDQ4-",F="login-module__error___40zxh",G="login-module__button___0kFBs",L="login-module__toggle___1JiG1",V="login-module__underline___gs-RS",H="login-module__phoneRow___oeNtq",q="login-module__select___rRV1O",D="login-module__phoneInput___2MPQC",R="login-module__fallbackCard___HdIk-",K="login-module__fallbackHeader___-il2v",U="login-module__fallbackDescription___ea5EB",J="login-module__fallbackActions___AD3ni",W="login-module__fallbackActionButton___lFgWf",$="login-module__actionTitle___ycrMp",Y="login-module__actionSubtext___opaIV",Z="login-module__linkButton___5lsoe";S(".login-module__container___YggDx{align-items:center;color:#fff;display:flex;justify-content:center}.login-module__card___Ub-Py{background-color:#1f2937;border-radius:.5rem;box-shadow:0 4px 6px rgba(0,0,0,.1);max-width:28rem;padding:2rem;width:100%}.login-module__heading___neEqb{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1.5rem;text-align:center}.login-module__message___qSejT{color:#68d391;text-align:center}.login-module__inputGroup___P6qgS{margin-bottom:1rem}.login-module__label___mx5vu{color:#d1d5db;display:block}.login-module__input___U07lW{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;margin-top:.25rem;padding:.5rem;width:100%}.login-module__input___U07lW:focus{box-shadow:0 0 0 2px #3b82f6;outline:none}.login-module__helperText___kDQ4-{color:#9ca3af;font-size:.75rem;margin-top:.5rem}.login-module__error___40zxh{color:#f87171;font-size:.875rem}.login-module__button___0kFBs{background-color:#2563eb;border-radius:.375rem;color:#fff;cursor:pointer;margin-top:1rem;padding:.5rem;transition:background-color .3s;width:100%}.login-module__button___0kFBs:hover{background-color:#1d4ed8}.login-module__button___0kFBs:disabled{background-color:#9ca3af;cursor:not-allowed}.login-module__toggle___1JiG1{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.login-module__underline___gs-RS{text-decoration:underline}.login-module__phoneRow___oeNtq{display:grid;gap:.5rem;grid-template-columns:1fr 3fr;margin-top:.25rem}.login-module__phoneInput___2MPQC,.login-module__select___rRV1O{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;padding:.5rem;width:100%}@media (max-width:500px){.login-module__phoneRow___oeNtq{grid-template-columns:1fr}}.login-module__fallbackCard___HdIk-{background:hsla(0,0%,100%,.04);border:1px solid hsla(0,0%,100%,.08);border-radius:12px;display:flex;flex-direction:column;gap:14px;margin-top:18px;padding:18px}.login-module__fallbackHeader___-il2v{color:#f3f4f6;font-size:.95rem;font-weight:600}.login-module__fallbackDescription___ea5EB{color:#9ca3af;font-size:.85rem;line-height:1.4}.login-module__fallbackActions___AD3ni{display:flex;flex-direction:column;gap:10px}.login-module__fallbackActionButton___lFgWf{background:rgba(0,0,0,.25);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;cursor:pointer;display:flex;flex-direction:column;padding:12px 14px;text-align:left;transition:all .15s ease}.login-module__fallbackActionButton___lFgWf:hover{background:hsla(0,0%,100%,.06);border-color:hsla(0,0%,100%,.15)}.login-module__actionTitle___ycrMp{color:#f9fafb;font-size:.9rem;font-weight:500}.login-module__actionSubtext___opaIV{color:#9ca3af;font-size:.75rem;margin-top:2px}.login-module__linkButton___5lsoe{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.8rem;margin-top:6px}.login-module__linkButton___5lsoe:hover{text-decoration:underline}");var Q="termsModal-module__overlay___-j6r5",X="termsModal-module__modal___4PxZV",ee="termsModal-module__header___B7wxb",oe="termsModal-module__title___Sucwt",ne="termsModal-module__closeBtn___evIs5",ie="termsModal-module__content___5BDhN",re="termsModal-module__link___oPZrU";S(".termsModal-module__overlay___-j6r5{align-items:center;background-color:rgba(0,0,0,.7);display:flex;inset:0;justify-content:center;position:fixed;z-index:999}.termsModal-module__modal___4PxZV{background-color:#1a1a1a;border-radius:8px;box-shadow:0 10px 25px rgba(0,0,0,.4);color:#fff;max-height:80vh;max-width:640px;outline:none;overflow-y:auto;padding:24px;width:100%}.termsModal-module__header___B7wxb{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.termsModal-module__title___Sucwt{color:#60a5fa;font-size:1.25rem;font-weight:700}.termsModal-module__closeBtn___evIs5{background:none;border:none;color:#ccc;cursor:pointer;font-size:1.75rem}.termsModal-module__closeBtn___evIs5:hover{color:#fff}.termsModal-module__content___5BDhN{color:#d1d5db;font-size:.9rem;line-height:1.6}.termsModal-module__link___oPZrU{color:#60a5fa;text-decoration:underline}.termsModal-module__link___oPZrU:hover{text-decoration:none}");const te=({isOpen:n,onClose:i})=>{const r=s(null);return a(()=>{const e=e=>{"Escape"===e.key&&i()};return n&&(document.addEventListener("keydown",e),r.current?.focus()),()=>{document.removeEventListener("keydown",e)}},[n,i]),n?e("div",{className:Q,role:"dialog","aria-modal":"true","aria-labelledby":"terms-title",children:o("div",{className:X,tabIndex:-1,ref:r,children:[o("div",{className:ee,children:[e("h2",{id:"terms-title",className:oe,children:"SMS Terms & Conditions"}),e("button",{onClick:i,className:ne,children:"×"})]}),o("div",{className:ie,children:[o("p",{children:[e("strong",{children:"Effective Date:"})," June 01, 2025"]}),e("p",{children:"By providing your phone number to SeamlessAuth, a Fells Code LLC product, you agree to receive SMS messages for identity verification, authentication, and account security."}),o("p",{children:[e("strong",{children:"1. Purpose:"})," SMS is used only for account security (OTP, MFA). No marketing messages."]}),o("p",{children:[e("strong",{children:"2. Frequency:"})," Based on login and account activity."]}),o("p",{children:[e("strong",{children:"3. Opt-Out:"})," Contact support@seamlessauth.com to opt out."]}),o("p",{children:[e("strong",{children:"4. Fees:"})," Message and data rates may apply."]}),o("p",{children:[e("strong",{children:"5. Supported Carriers:"})," Most major providers supported, delivery not guaranteed."]}),o("p",{children:[e("strong",{children:"6. Privacy:"})," Your phone number is not shared or sold. See our Privacy Policy."]}),o("p",{children:[e("strong",{children:"7. Changes:"})," Terms may be updated with notice on this page."]}),o("p",{children:["Questions? Email us at"," ",e("a",{className:re,href:"mailto:support@seamlessauth.com",children:"support@seamlessauth.com"}),"."]})]})]})}):null},ae=[{code:"US",name:"United States",dialCode:"+1",flag:"🇺🇸"},{code:"CA",name:"Canada",dialCode:"+1",flag:"🇨🇦"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"🇬🇧"},{code:"IN",name:"India",dialCode:"+91",flag:"🇮🇳"},{code:"AU",name:"Australia",dialCode:"+61",flag:"🇦🇺"}];function le({phone:n,setPhone:i,phoneError:r,setPhoneError:l}){const[s,d]=t(!1),[c,_]=t(ae[0]);a(()=>{const e=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().locale||"en-US",o=e.split("-")[1]?.toUpperCase()||"US";return ae.find(e=>e.code===o)||ae[0]}catch{return ae[0]}}();_(e)},[]);return o("div",{className:j,children:[e("label",{id:"phone",className:A,children:"Phone Number"}),o("div",{className:H,children:[e("select",{value:c.code,onChange:e=>{const o=ae.find(o=>o.code===e.target.value);if(o){_(o);const e=n.replace(/^\+\d+/,""),r=(new b).input(o.dialCode+e);i(r)}},className:q,children:ae.map(e=>o("option",{value:e.code,children:[e.flag," (",e.dialCode,")"]},e.code))}),e("input",{"aria-labelledby":"phone",type:"tel",value:n,onChange:e=>{const o=e.target.value,n=o.startsWith(c.dialCode)?o:c.dialCode+o,t=(new b).input(n);i(t),r&&l("")},onBlur:()=>{if(n){const e=k(n),o=e?.isValid();l(o?"":"Please enter a valid phone number.")}},autoComplete:"off",placeholder:"(555) 123-4567",className:D})]}),o("p",{className:z,children:["By signing up, you agree to our"," ",e("button",{onClick:()=>d(!0),className:V,children:"SMS Terms & Conditions"}),"."]}),r&&e("p",{className:F,children:r}),e(te,{isOpen:s,onClose:()=>d(!1)})]})}const se=e=>{if("string"!=typeof e)return!1;const o=e.trim();if(o.length<3||o.length>320)return!1;const n=o.split("@");if(2!==n.length)return!1;const[i,r]=n;return!(!/^[A-Za-z0-9._%+-]+$/.test(i)||i.startsWith(".")||i.endsWith(".")||i.includes(".."))&&!(!/^[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(r)||r.startsWith("-")||r.endsWith("-")||r.startsWith(".")||r.endsWith(".")||r.includes(".."))},de=e=>{const o=y(e);return o?.isValid()||!1};async function ce(){if(window.PublicKeyCredential&&"function"==typeof window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable)try{return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}catch(e){return console.error("Error checking passkey support:",e),!1}return!1}const _e=({identifier:n,onMagicLink:i,onPhoneOtp:r,onPasskeyRetry:t})=>{const a=se(n),l=de(n);return o("div",{className:R,children:[e("div",{className:K,children:"Passkeys unavailable on this device"}),e("p",{className:U,children:"Choose another secure sign-in method."}),o("div",{className:J,children:[a&&o("button",{type:"button",className:W,onClick:i,children:[e("span",{className:$,children:"Email Magic Link"}),e("span",{className:Y,children:"Send a secure sign-in link to your email"})]}),l&&o("button",{type:"button",className:W,onClick:r,children:[e("span",{className:$,children:"Text Message Code"}),e("span",{className:Y,children:"Receive a one-time code via SMS"})]})]}),e("button",{type:"button",className:Z,onClick:t,children:"Try passkey anyway"})]})},me=()=>{const i=d(),{apiHost:r,hasSignedInBefore:l,mode:s}=T(),{validateToken:c}=w(),[_,m]=t(""),[u,g]=t(""),[h,f]=t("register"),[y,b]=t(""),[k,v]=t(""),[x,P]=t(""),[C,M]=t(""),[S,V]=t(""),[H,q]=t(!1),[D,R]=t(!1),K=N({authMode:s,authHost:r});a(()=>{!async function(){const e=await ce();q(e)}(),l&&f("login")},[l]);const U=async()=>{try{const e=await K("/webAuthn/login/start",{method:"POST"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),n=await p({optionsJSON:o}),r=await K("/webAuthn/login/finish",{method:"POST",body:JSON.stringify({assertionResponse:n})});r.ok||console.error("Failed to verify passkey");const t=await r.json();if("Success"===t.message)return t.mfaLogin?void i("/mfaLogin"):(await c(),void i("/"));console.error("Passkey login failed:",t.message)}catch(e){console.error("Passkey login error:",e)}};return e("div",{className:I,children:o("div",{className:O,children:[e("h2",{className:E,children:"login"===h?"Sign In":"Create Account"}),e(n,{children:o("form",{onSubmit:async e=>{e.preventDefault(),"login"===h&&(async()=>{if(v(""),(await K("/login",{method:"POST",body:JSON.stringify({identifier:_,passkeyAvailable:H})})).ok)if(H)try{await U()}catch(e){console.error("Passkey login failed",e),R(!0)}else R(!0);else v("Failed to send login link. Please try again.")})(),"register"===h&&(async()=>{v("");try{const e=await K("/registration/register",{method:"POST",body:JSON.stringify({email:u,phone:y})});if(!e.ok)return void v("Failed to register. Please try again.");"Success"===(await e.json()).message&&i("/verifyPhoneOTP"),v("An unexpected error occured. Try again. If the problem persists, try resetting your password")}catch(e){console.error("Unexpected login error",e),v("An unexpected error occured. Try again. If the problem persists, try resetting your password")}})()},children:["login"===h&&o("div",{className:j,children:[e("label",{htmlFor:"identifier",className:A,children:"Email Address / Phone Number"}),e("input",{id:"identifier",type:"text",value:_,onChange:e=>{const o=e.target.value;m(o)},autoComplete:"off",placeholder:"Email or Phone Number",className:B,onBlur:()=>{if(_){const e=se(_)||de(_);V(e?"":"Please enter a valid email or phone number")}},required:!0}),e("p",{className:z,children:"Phone numbers must include a country code e.g. +1"}),D&&e(_e,{identifier:_,onMagicLink:async()=>{try{if(!(await K("/magic-link",{method:"GET"})).ok)return void v("Failed to send magic link.");i("/magic-link-sent")}catch(e){console.error(e),v("Failed to send magic link.")}},onPhoneOtp:async()=>{try{if(!(await K("/login/phone-otp",{method:"POST",body:JSON.stringify({identifier:_})})).ok)return void v("Failed to send OTP.");i("/verifyPhoneOTP")}catch(e){console.error(e),v("Failed to send OTP.")}},onPasskeyRetry:U}),S&&e("p",{className:F,children:S})]}),"register"===h&&o(n,{children:[o("div",{className:j,children:[e("label",{htmlFor:"email",className:A,children:"Email Address"}),e("input",{id:"email",type:"email",value:u,onChange:e=>{const o=e.target.value;g(o)},autoComplete:"off",className:B,onBlur:()=>{if(u){const e=se(u);M(e?"":"Please enter a valid email")}},required:!0}),C&&e("p",{className:F,children:C})]}),e(le,{phone:y,setPhone:b,phoneError:x,setPhoneError:P})]}),e("button",{type:"submit",className:G,disabled:!("login"===h&&_?se(_)||de(_):se(u)&&de(y)),children:"login"===h?"Login":"Register"}),k&&e("p",{className:F,children:k}),e("button",{type:"button",onClick:()=>f("login"===h?"register":"login"),className:L,children:"login"===h?"Don't have an account? Create one":"Already have an account? Sign in"})]})})]})})};var ue="passKeyLogin-module__container___IUKxF",ge="passKeyLogin-module__card___2sKM1",pe="passKeyLogin-module__title___HZxvc",he="passKeyLogin-module__button___FvR4I";S(".passKeyLogin-module__container___IUKxF{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.passKeyLogin-module__card___2sKM1{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);display:flex;flex-direction:column;gap:1.5rem;max-width:400px;padding:2rem;width:100%}.passKeyLogin-module__title___HZxvc{color:#fff;font-size:1.5rem;font-weight:600;text-align:center}.passKeyLogin-module__button___FvR4I{background-color:#2563eb;border:1px solid #3b82f6;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;text-align:center;transition:background-color .2s ease;width:100%}.passKeyLogin-module__button___FvR4I:hover{background-color:#1d4ed8}@media (max-width:480px){.passKeyLogin-module__card___2sKM1{padding:1.25rem}.passKeyLogin-module__button___FvR4I{font-size:1rem}}");const fe=()=>{const n=d(),{apiHost:i,mode:r}=T(),{validateToken:t}=w(),a=N({authMode:r,authHost:i});return e("div",{className:ue,children:o("div",{className:ge,children:[e("h2",{className:pe,children:"Login with Passkey"}),e("button",{onClick:async()=>{try{const e=await a("/webAuthn/login/start",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),i=await p({optionsJSON:o}),r=await a("/webAuthn/login/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:i}),credentials:"include"});r.ok||console.error("Failed to verify passkey");const l=await r.json();if("Success"===l.message)return l.mfaLogin&&n("/mfaLogin"),await t(),void n("/");console.error("Passkey login failed")}catch{console.error("Passkey login error")}},className:he,children:"Use Passkey"})]})})};var ye="registerPasskey-module__container___jqEh8",be="registerPasskey-module__card___MJAyC",ke="registerPasskey-module__loading___Q4i1x",ve="registerPasskey-module__spinner___V1nhd",xe="registerPasskey-module__supported___ihTih",we="registerPasskey-module__title___vn2Qu",Ne="registerPasskey-module__description___AWmO-",Pe="registerPasskey-module__button___D3b4B",Ce="registerPasskey-module__message___RiOw-",Te="registerPasskey-module__success___HP5aX",Me="registerPasskey-module__error___hGiqE";S(".registerPasskey-module__container___jqEh8{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.registerPasskey-module__card___MJAyC{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);max-width:400px;padding:1.5rem;width:100%}.registerPasskey-module__loading___Q4i1x{align-items:center;background-color:#f9fafb;border-radius:.75rem;box-shadow:0 2px 8px rgba(0,0,0,.1);color:#374151;display:flex;font-weight:500;gap:.75rem;justify-content:center;padding:1.5rem}.registerPasskey-module__spinner___V1nhd{animation:registerPasskey-module__spin___oYcsC 1s linear infinite;border-color:#3b82f6 transparent;border-radius:9999px;border-style:solid;border-width:2px;height:1.5rem;width:1.5rem}@keyframes registerPasskey-module__spin___oYcsC{to{transform:rotate(1turn)}}.registerPasskey-module__supported___ihTih{background-color:#ecfdf5;border-radius:.75rem;box-shadow:0 2px 12px rgba(0,0,0,.1);color:#065f46;padding:1.25rem}.registerPasskey-module__title___vn2Qu{font-size:1.125rem;font-weight:600;margin-bottom:.5rem}.registerPasskey-module__description___AWmO-{margin-bottom:1rem}.registerPasskey-module__button___D3b4B{background-color:#059669;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__button___D3b4B:hover{background-color:#047857}.registerPasskey-module__message___RiOw-{font-size:.875rem;margin-top:1rem}.registerPasskey-module__success___HP5aX{color:#6ee7b7}.registerPasskey-module__error___hGiqE{color:#f87171}");var Se="deviceNameModal-module__overlay___fmdPd",Ie="deviceNameModal-module__modal___uoEda",Oe="deviceNameModal-module__description___-HMTA",Ee="deviceNameModal-module__input___4vQMI",je="deviceNameModal-module__actions___KXw7b",Ae="deviceNameModal-module__primary___9Ozlk",Be="deviceNameModal-module__secondary___HILhc";S(".deviceNameModal-module__overlay___fmdPd{align-items:center;background:rgba(0,0,0,.45);display:flex;inset:0;justify-content:center;position:fixed;z-index:1000}.deviceNameModal-module__modal___uoEda{background:#1f2937;border-radius:12px;box-shadow:0 20px 40px rgba(0,0,0,.15);color:#fff;max-width:420px;padding:24px;width:100%}.deviceNameModal-module__description___-HMTA{color:#fff;font-size:14px;margin-bottom:16px}.deviceNameModal-module__input___4vQMI{border:1px solid #ddd;border-radius:8px;font-size:14px;margin-bottom:20px;padding:10px 12px;width:100%}.deviceNameModal-module__actions___KXw7b{display:flex;gap:10px;justify-content:flex-end}.deviceNameModal-module__primary___9Ozlk{background:#2563eb;border:none;border-radius:8px;color:#fff;cursor:pointer;padding:8px 14px}.deviceNameModal-module__secondary___HILhc{background:transparent;border:1px solid #ccc;border-radius:8px;cursor:pointer;padding:8px 14px}");const ze=({isOpen:n,onCancel:i,onConfirm:r})=>{const[a,l]=t("");return n?e("div",{className:Se,children:o("div",{className:Ie,children:[e("h3",{children:"Name This Device"}),e("p",{className:Oe,children:"Give this passkey a friendly name so you can recognize it later."}),e("input",{type:"text",placeholder:"e.g., MacBook Pro, iPhone, YubiKey",value:a,onChange:e=>l(e.target.value),className:Ee,autoFocus:!0}),o("div",{className:je,children:[e("button",{onClick:i,className:Be,children:"Cancel"}),e("button",{onClick:()=>r(a.trim()),disabled:!a.trim(),className:Ae,children:"Continue"})]})]})}):null},Fe=()=>{const{apiHost:i,mode:r}=T(),{validateToken:l}=w(),s=d(),[c,_]=t("idle"),[m,u]=t(""),[g,p]=t(!1),[y,b]=t(!1),[k,v]=t(null),x=N({authMode:r,authHost:i});a(()=>{!async function(){const e=await ce();p(e)}()},[]);const P=async(e,o)=>{if(!(await x("/webAuthn/register/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attestationResponse:e,metadata:o}),credentials:"include"})).ok)throw new Error("Verification failed");await l()};return o(n,{children:[e("div",{className:ye,children:e("div",{className:be,children:o("div",g?{className:xe,children:[e("h2",{className:we,children:"Secure Your Account with a Passkey"}),e("p",{className:Ne,children:"Your device supports passkeys! Register one to skip passwords forever."}),e("button",{onClick:()=>{const{platform:e,browser:o,deviceInfo:n}=function(){const e=navigator.userAgent.toLowerCase();let o="unknown",n="unknown";return/iphone|ipad|ipod/.test(e)?o="ios":/android/.test(e)?o="android":/mac os/.test(e)?o="mac":/windows/.test(e)?o="windows":/linux/.test(e)&&(o="linux"),/chrome/.test(e)&&(n="chrome"),/safari/.test(e)&&!/chrome/.test(e)&&(n="safari"),/firefox/.test(e)&&(n="firefox"),/edg/.test(e)&&(n="edge"),{platform:o,browser:n,deviceInfo:`${o} • ${n}`}}();v({platform:e,browser:o,deviceInfo:n}),b(!0)},disabled:"loading"===c,className:Pe,children:"loading"===c?"Registering...":"Register Passkey"}),m&&e("p",{className:`${Ce} ${"success"===c?Te:Me}`,children:m})]}:{className:ke,children:[e("div",{className:ve}),e("span",{children:"Checking for Passkey Support..."})]})})}),e(ze,{isOpen:y,onCancel:()=>{b(!1),v(null)},onConfirm:async e=>{if(!k)return;const{platform:o,browser:n,deviceInfo:i}=k;_("loading");try{const r=await x("/webAuthn/register/start",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!r.ok)throw new Error("Failed to fetch challenge");const t=await r.json();let a;try{a=await h({optionsJSON:t})}catch(e){if(e instanceof f)throw new Error(e.name);throw e}await P(a,{friendlyName:e,platform:o,browser:n,deviceInfo:i}),_("success"),u("Passkey registered successfully."),s("/")}catch(e){console.error(e),_("error"),u("Error registering passkey.")}finally{b(!1),v(null)}}})]})};var Ge="verifyOTP-module__container___wgoDE",Le="verifyOTP-module__card___3cs2p",Ve="verifyOTP-module__title___fZ-1d",He="verifyOTP-module__subtitle___dGSu3",qe="verifyOTP-module__error___GEtlG",De="verifyOTP-module__success___46TjG",Re="verifyOTP-module__form___jiGG-",Ke="verifyOTP-module__label___Zq5Mi",Ue="verifyOTP-module__timer___smq-a",Je="verifyOTP-module__input___yqIXM",We="verifyOTP-module__resend___PlmkG",$e="verifyOTP-module__button___8pIuO",Ye="verifyOTP-module__toggle___wbzVa";S(".verifyOTP-module__container___wgoDE{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyOTP-module__card___3cs2p{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyOTP-module__title___fZ-1d{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyOTP-module__subtitle___dGSu3{color:#9ca3af;font-size:.875rem;margin-bottom:1.5rem;text-align:center}.verifyOTP-module__error___GEtlG{color:#f87171;margin-bottom:1rem;text-align:center}.verifyOTP-module__success___46TjG{color:#34d399;margin-bottom:.75rem;text-align:center}.verifyOTP-module__form___jiGG-{display:flex;flex-direction:column;gap:1rem}.verifyOTP-module__label___Zq5Mi{color:#d1d5db;display:block;font-size:.875rem;margin-bottom:.25rem}.verifyOTP-module__timer___smq-a{color:#facc15;font-size:.875rem}.verifyOTP-module__input___yqIXM{background-color:#374151;border:1px solid #4b5563;border-radius:.375rem;color:#fff;outline:none;padding:.5rem;width:100%}.verifyOTP-module__input___yqIXM:focus{box-shadow:0 0 0 2px #3b82f6}.verifyOTP-module__resend___PlmkG{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.75rem;margin-top:.25rem;text-decoration:underline}.verifyOTP-module__resend___PlmkG:hover{color:#3b82f6}.verifyOTP-module__button___8pIuO{background-color:#2563eb;border:none;border-radius:.375rem;color:#fff;cursor:pointer;padding:.5rem;transition:background-color .2s;width:100%}.verifyOTP-module__button___8pIuO:hover{background-color:#1d4ed8}.verifyOTP-module__toggle___wbzVa{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}");var Ze="otpInput-module__otpContainer___MUjby",Qe="otpInput-module__otpInput___3YMVm";S(".otpInput-module__otpContainer___MUjby{display:flex;gap:8px;justify-content:center;margin-top:8px}.otpInput-module__otpInput___3YMVm{background:#374151;border:1px solid #4b5563;border-radius:8px;color:#fff;font-size:1.2rem;height:48px;text-align:center;transition:border-color .15s ease,box-shadow .15s ease;width:42px}.otpInput-module__otpInput___3YMVm:focus{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.25);outline:none}");const Xe=({length:o=6,value:n,onChange:i})=>{const r=s([]),t=n.split("").concat(Array(o).fill("")).slice(0,o);return e("div",{className:Ze,onPaste:e=>{const n=e.clipboardData.getData("text").replace(/\D/g,"");n.length===o&&(i(n),r.current[o-1]?.focus()),e.preventDefault()},children:t.map((o,a)=>e("input",{ref:e=>r.current[a]=e,type:"text",inputMode:"numeric",maxLength:1,value:o||"",className:Qe,onChange:e=>((e,o)=>{if(!/^\d?$/.test(o))return;const t=n.substring(0,e)+o+n.substring(e+1);i(t.trim()),o&&r.current[e+1]&&r.current[e+1]?.focus()})(a,e.target.value),onKeyDown:e=>((e,o)=>{"Backspace"===o.key&&!t[e]&&r.current[e-1]&&r.current[e-1]?.focus()})(a,e)},a))})},eo=()=>{const n=d(),{apiHost:i,mode:r}=T(),[l,s]=t(""),[c,_]=t(null),[m,u]=t(""),[g,p]=t(!1),[h,f]=t(""),[y,b]=t(300),k=N({authMode:r,authHost:i}),v=async()=>{p(!0);try{if(!c){(await k("/otp/verify-phone-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:l}),credentials:"include"})).ok?_(!0):u("Verification failed.")}}catch(e){console.error(e),u("Verification failed.")}p(!1)},x=async()=>{f(""),await(async()=>{u("");const e=await k("/otp/generate-phone-otp",{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(o.token&&localStorage.setItem("token",o.token),f("Verification SMS has been resent.")):u("Failed to send SMS code. If this persists, refresh the page and try again.")})(),f("Verification SMS has been resent.")};return a(()=>{const e=setInterval(()=>{b(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{c&&(async()=>{(await k("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}})).ok?n("/verifyEmailOTP"):u("Failed to send Email code. If this persists, refresh the page and try registering again.")})()},[c,n,k]),e("div",{className:Ge,children:o("div",{className:Le,children:[e("h2",{className:Ve,children:"Verify Your Phone Number"}),e("p",{className:He,children:"Enter the code sent to your phone number."}),m&&e("p",{className:qe,children:m}),h&&e("p",{className:De,children:h}),o("form",{onSubmit:async e=>{if(e.preventDefault(),u(""),6===l.length){p(!0);try{v()}catch{u("Unexpected error occurred.")}finally{p(!1)}}else u("Please enter a valid code.")},className:Re,children:[o("div",{children:[o("label",{htmlFor:"phoneCode",className:Ke,children:["Phone Verification Code ",(P=c,!0===P?e("span",{className:"text-green-400 ml-2",children:"✅"}):!1===P?e("span",{className:"text-red-400 ml-2",children:"❌"}):null)," -"," ",o("span",{className:Ue,children:["Code expires in: ",(w=y,`${Math.floor(w/60).toString().padStart(2,"0")}:${(w%60).toString().padStart(2,"0")}`)]})]}),e(Xe,{length:6,value:l,onChange:s}),e("button",{type:"button",onClick:()=>x(),className:We,children:"Resend code to phone"})]}),e("button",{type:"submit",className:$e,children:g?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>n("/login"),className:Ye,children:"Back to login"})]})]})});var w,P},oo=()=>{const n=d(),{apiHost:i,mode:r}=T(),{validateToken:l}=w(),[s,c]=t(!1),[_,m]=t(""),[u,g]=t(300),[p,h]=t(""),[f,y]=t(""),[b,k]=t(!1),v=N({authMode:r,authHost:i});return a(()=>{const e=setInterval(()=>{g(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{!async function(){const e=await ce();k(e)}()},[]),e("div",{className:Ge,children:o("div",{className:Le,children:[e("h2",{className:Ve,children:"Verify Your Email"}),e("p",{className:He,children:"We sent you a verification email. Enter the code below."}),p&&e("p",{className:qe,children:p}),f&&e("p",{className:De,children:f}),o("form",{onSubmit:async e=>{if(e.preventDefault(),h(""),6===_.length){c(!0);try{if(!(await v("/otp/verify-email-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:_}),credentials:"include"})).ok)return void h("Verification failed.");b?n("/registerPasskey"):(await l(),n("/"))}catch(e){console.error(e),h("Verification failed.")}finally{c(!1)}}else h("Please enter a valid code.")},className:Re,children:[o("div",{children:[o("label",{htmlFor:"emailCode",className:Ke,children:["Email Verification Code",o("span",{className:Ue,children:[" ","— Code expires in ",(x=u,`${Math.floor(x/60).toString().padStart(2,"0")}:${(x%60).toString().padStart(2,"0")}`)]})]}),e("input",{id:"emailCode",type:"text",maxLength:6,value:_,autoComplete:"off",onChange:e=>m(e.target.value),className:Je,required:!0}),e("button",{type:"button",onClick:async()=>{h(""),y("");(await v("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}})).ok?y("Verification email has been resent."):h("Failed to send Email code. If this persists, refresh the page and try again.")},className:We,children:"Resend code to email"})]}),e("button",{type:"submit",className:$e,disabled:s,children:s?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>n("/login"),className:Ye,children:"Back to login"})]})]})});var x};var no={container:"verifyMagiclink-module__container___qrSXf",card:"verifyMagiclink-module__card___niKgr",title:"verifyMagiclink-module__title___SumxD",verificationContent:"verifyMagiclink-module__verificationContent___NdsS0",spinner:"verifyMagiclink-module__spinner___lnW1k",successIcon:"verifyMagiclink-module__successIcon___XjFEM",checkIcon:"verifyMagiclink-module__checkIcon___I0JOP",successText:"verifyMagiclink-module__successText___lO5Qq"};S(".verifyMagiclink-module__container___qrSXf{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyMagiclink-module__card___niKgr{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyMagiclink-module__title___SumxD{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyMagiclink-module__verificationContent___NdsS0{align-items:center;display:flex;flex-direction:column;gap:14px;margin:20px 0}.verifyMagiclink-module__spinner___lnW1k{animation:verifyMagiclink-module__spin___2lGzj .9s linear infinite;border:3px solid hsla(0,0%,100%,.15);border-radius:50%;border-top-color:#60a5fa;height:28px;width:28px}.verifyMagiclink-module__successIcon___XjFEM{align-items:center;background:rgba(16,185,129,.15);border-radius:50%;display:flex;height:36px;justify-content:center;width:36px}.verifyMagiclink-module__checkIcon___I0JOP{animation:verifyMagiclink-module__checkPop___-3qJu .25s ease-out;color:#34d399;height:22px;width:22px}.verifyMagiclink-module__successText___lO5Qq{color:#34d399;font-size:.9rem}@keyframes verifyMagiclink-module__checkPop___-3qJu{0%{opacity:0;transform:scale(.6)}80%{transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@keyframes verifyMagiclink-module__spin___2lGzj{to{transform:rotate(1turn)}}");const io=()=>{const[n]=c(),i=d(),r=n.get("token"),{apiHost:l,mode:s}=T(),[_,m]=t(""),[u,g]=t(""),p=N({authMode:s,authHost:l});return a(()=>{r?(async()=>{if(!(await p(`/magic-link/verify/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}})).ok)return console.error("Failed to verify token"),void m("Failed to verify token");new BroadcastChannel("seamless-auth").postMessage({type:"MAGIC_LINK_AUTH_SUCCESS"}),g("You have been verified on the device and browser that initiated this request"),setTimeout(()=>{i("/")},900)})():(m("Missing token for verification."),console.error("No token found",r))},[r,p,i]),e("div",{className:no.container,children:o("div",{className:no.card,children:[e("h1",{className:no.title,children:"Verifying your login"}),o("div",{className:no.verificationContent,children:[!u&&!_&&e("div",{className:no.spinner}),u&&e("div",{className:no.successIcon,children:e("svg",{viewBox:"0 0 24 24",className:no.checkIcon,fill:"none",stroke:"currentColor",strokeWidth:"2",children:e("path",{d:"M5 13l4 4L19 7"})})}),!u&&!_&&e("p",{className:no.helperText,children:"Please wait while we securely verify your sign-in link."}),u&&e("p",{className:no.successText,children:"Login verified. Redirecting…"}),_&&e("p",{className:no.error,children:_})]})]})})};var ro="magiclink-module__container___45zcA",to="magiclink-module__card___Au9oN",ao="magiclink-module__iconWrapper___k5ndr",lo="magiclink-module__mailIcon___Pwb7q",so="magiclink-module__iconRing___bdLvf",co="magiclink-module__heading___b9cre",_o="magiclink-module__message___kiVFj",mo="magiclink-module__identifier___JtcFM",uo="magiclink-module__helperText___7Mlfh",go="magiclink-module__actions___64I-3",po="magiclink-module__secondaryButton___BntAI",ho="magiclink-module__cooldown___Ib4rm",fo="magiclink-module__linkButton___maJiv";S(".magiclink-module__container___45zcA{align-items:center;color:#fff;display:flex;justify-content:center}.magiclink-module__card___Au9oN{background-color:#1f2937;border-radius:.75rem;box-shadow:0 10px 25px rgba(0,0,0,.25);max-width:420px;padding:2.5rem 2rem;text-align:center;width:100%}.magiclink-module__iconWrapper___k5ndr{display:flex;justify-content:center;margin-bottom:1.25rem;position:relative}.magiclink-module__mailIcon___Pwb7q{color:#a5b4fc;height:38px;width:38px;z-index:2}.magiclink-module__iconRing___bdLvf{animation:magiclink-module__pulse___YGm-I 2s infinite;background:rgba(99,102,241,.15);border-radius:50%;height:72px;position:absolute;width:72px}@keyframes magiclink-module__pulse___YGm-I{0%{opacity:.8;transform:scale(.6)}70%{opacity:0;transform:scale(1.4)}to{opacity:0}}.magiclink-module__heading___b9cre{font-size:1.55rem;font-weight:600;margin-bottom:.75rem}.magiclink-module__message___kiVFj{color:#d1d5db;font-size:.95rem;line-height:1.4;margin-bottom:1rem}.magiclink-module__identifier___JtcFM{background:hsla(0,0%,100%,.05);border-radius:6px;display:inline-block;font-size:1rem;font-weight:600;margin-bottom:1rem;padding:.45rem .6rem}.magiclink-module__helperText___7Mlfh{color:#9ca3af;font-size:.85rem;line-height:1.4;margin-bottom:.6rem}.magiclink-module__actions___64I-3{display:flex;flex-direction:column;gap:.6rem;margin-top:1.6rem}.magiclink-module__secondaryButton___BntAI{background:#111827;border:1px solid #374151;border-radius:8px;color:#fff;cursor:pointer;font-weight:500;padding:.65rem}.magiclink-module__secondaryButton___BntAI:hover:not(:disabled){background:#1f2937}.magiclink-module__secondaryButton___BntAI:disabled{cursor:not-allowed;opacity:.5}.magiclink-module__cooldown___Ib4rm{color:#9ca3af;font-size:.8rem}.magiclink-module__linkButton___maJiv{background:none;border:none;color:#a5b4fc;cursor:pointer;font-size:.85rem;margin-top:.4rem}.magiclink-module__linkButton___maJiv:hover{text-decoration:underline}");const yo=()=>{const{apiHost:n,mode:i}=T(),{validateToken:r}=w(),l=d(),s=_(),c=N({authMode:i,authHost:n}),m=s.state?.identifier,[u,g]=t(30);a(()=>{const e=setInterval(()=>{g(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]);return a(()=>{const e=new BroadcastChannel("seamless-auth");return e.onmessage=async e=>{if("MAGIC_LINK_AUTH_SUCCESS"===e.data?.type){200===(await c("/magic-link/check",{method:"GET",headers:{"Content-Type":"application/json"}})).status&&(await r(),l("/"))}},()=>{e.close()}},[c,l,r]),a(()=>{const e=setInterval(async()=>{try{200===(await c("/magic-link/check",{method:"GET",headers:{"Content-Type":"application/json"}})).status&&(await r(),l("/"))}catch{}},5e3);return()=>clearInterval(e)},[n,r,l]),e("div",{className:ro,children:o("div",{className:to,children:[o("div",{className:ao,children:[e("div",{className:so}),o("svg",{className:lo,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e("path",{d:"M4 6h16v12H4z"}),e("path",{d:"m4 6 8 6 8-6"})]})]}),e("h2",{className:co,children:"Check your email"}),e("p",{className:_o,children:"If an account exists for this address, we sent a secure sign-in link."}),e("div",{className:mo,children:m}),e("p",{className:uo,children:"Open the email and click the link to finish signing in."}),e("p",{className:uo,children:"Didn’t receive anything? Check your spam folder or try creating a new account."}),o("div",{className:go,children:[e("button",{className:po,disabled:u>0,onClick:async()=>{u>0||(await c("/magic-link",{method:"GET",headers:{"Content-Type":"application/json"}}),g(30))},children:"Resend link"}),u>0&&o("div",{className:ho,children:["Available in ",u,"s"]}),e("button",{className:fo,onClick:()=>l("/login"),children:"Change email or phone"})]})]})})},bo=()=>o(m,{children:[e(u,{path:"/login",element:e(me,{})}),e(u,{path:"/passKeyLogin",element:e(fe,{})}),e(u,{path:"/verifyPhoneOTP",element:e(eo,{})}),e(u,{path:"/verifyEmailOTP",element:e(oo,{})}),e(u,{path:"/verify-magiclink",element:e(io,{})}),e(u,{path:"/registerPasskey",element:e(Fe,{})}),e(u,{path:"/magic-link-sent",element:e(yo,{})}),e(u,{path:"*",element:e(g,{to:"/login",replace:!0})})]});export{M as AuthProvider,bo as AuthRoutes,T as useAuth};
1
+ import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{createContext as i,useContext as r,useState as t,useEffect as a,useCallback as l,useRef as s}from"react";import{useNavigate as d,useSearchParams as c,useLocation as _,Routes as m,Route as u,Navigate as g}from"react-router-dom";import{startAuthentication as p,startRegistration as h,WebAuthnError as f}from"@simplewebauthn/browser";import y,{AsYouType as b,parsePhoneNumberFromString as k}from"libphonenumber-js";const v=i(void 0),x=({value:o,children:n})=>e(v.Provider,{value:o,children:n}),w=()=>{const e=r(v);if(!e)throw new Error("useInternalAuth must be used within InternalAuthProvider");return e},N=e=>{const{authMode:o,authHost:n}=e;return async function(e,i){const r=`${n}${"server"===o?"auth":""}${e.startsWith("/")?e:`/${e}`}`,t={...i,credentials:"include",headers:{"Content-Type":"application/json",...i?.headers}},a=await fetch(r,t);if(a.ok)return a;throw console.warn("Auth fetch failed:",a.status,r),new Error(`Failed to make API call to ${r}`)}};const P=i(void 0),C=()=>{const e=r(P);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},T=({children:o,apiHost:n,autoDetectPreviousSignin:i=!0,mode:r="web"})=>{const[s,d]=t(null),[c,_]=t([]),[m,u]=t(!1),[g,p]=t(!0),[h,f]=t(null),{hasSignedInBefore:y,markSignedIn:b}=function(e="seamlessauth_seen"){const[o,n]=t(!1);return a(()=>{try{"true"===localStorage.getItem(e)&&n(!0)}catch{}},[e]),{hasSignedInBefore:o,markSignedIn:()=>{try{localStorage.setItem(e,"true"),n(!0)}catch{}}}}(),[k]=t(r),v=N({authMode:k,authHost:n}),w=l(async()=>{if(s)try{await v("/logout",{method:"GET"})}catch{console.error("Error during logout")}finally{u(!1),d(null),f(null)}},[v,s]),C=async()=>{p(!0);try{const e=await v("users/me",{method:"GET"});if(e.ok){const{user:o,credentials:n}=await e.json();d(o),_(n),u(!0)}else w()}catch{w()}finally{p(!1)}};return a(()=>{C()},[]),a(()=>{s&&m&&b()},[s,m,b]),e(P.Provider,{value:{user:s,logout:w,loading:g,deleteUser:async()=>{try{if((await v("/users/delete",{method:"delete"})).ok)return d(null),u(!1),void f(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:m,hasRole:e=>s?.roles?.includes(e),apiHost:n,token:h,markSignedIn:b,hasSignedInBefore:!!i&&y,mode:r,credentials:c,updateCredential:async e=>{const o=await v("users/credentials",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({friendlyName:e.friendlyName,id:e.id})});if(o.ok)return o.json();throw new Error("Failed to update credential")},deleteCredential:async e=>{const o=await v("users/credentials",{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})});if(o.ok)return o.json();throw new Error("Failed to update credential")}},children:e(x,{value:{validateToken:C,setLoading:p},children:o})})};function M(e,o){void 0===o&&(o={});var n=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var S="login-module__container___YggDx",I="login-module__card___Ub-Py",O="login-module__heading___neEqb",E="login-module__inputGroup___P6qgS",A="login-module__label___mx5vu",j="login-module__input___U07lW",B="login-module__helperText___kDQ4-",z="login-module__error___40zxh",F="login-module__button___0kFBs",G="login-module__toggle___1JiG1",L="login-module__underline___gs-RS",V="login-module__phoneRow___oeNtq",D="login-module__select___rRV1O",H="login-module__phoneInput___2MPQC",R="login-module__fallbackCard___HdIk-",U="login-module__fallbackHeader___-il2v",q="login-module__fallbackDescription___ea5EB",K="login-module__fallbackActions___AD3ni",J="login-module__fallbackActionButton___lFgWf",W="login-module__actionTitle___ycrMp",$="login-module__actionSubtext___opaIV",Y="login-module__linkButton___5lsoe";M(".login-module__container___YggDx{align-items:center;color:#fff;display:flex;justify-content:center}.login-module__card___Ub-Py{background-color:#1f2937;border-radius:.5rem;box-shadow:0 4px 6px rgba(0,0,0,.1);max-width:28rem;padding:2rem;width:100%}.login-module__heading___neEqb{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1.5rem;text-align:center}.login-module__message___qSejT{color:#68d391;text-align:center}.login-module__inputGroup___P6qgS{margin-bottom:1rem}.login-module__label___mx5vu{color:#d1d5db;display:block}.login-module__input___U07lW{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;margin-top:.25rem;padding:.5rem;width:100%}.login-module__input___U07lW:focus{box-shadow:0 0 0 2px #3b82f6;outline:none}.login-module__helperText___kDQ4-{color:#9ca3af;font-size:.75rem;margin-top:.5rem}.login-module__error___40zxh{color:#f87171;font-size:.875rem}.login-module__button___0kFBs{background-color:#2563eb;border-radius:.375rem;color:#fff;cursor:pointer;margin-top:1rem;padding:.5rem;transition:background-color .3s;width:100%}.login-module__button___0kFBs:hover{background-color:#1d4ed8}.login-module__button___0kFBs:disabled{background-color:#9ca3af;cursor:not-allowed}.login-module__toggle___1JiG1{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.login-module__underline___gs-RS{text-decoration:underline}.login-module__phoneRow___oeNtq{display:grid;gap:.5rem;grid-template-columns:1fr 3fr;margin-top:.25rem}.login-module__phoneInput___2MPQC,.login-module__select___rRV1O{background-color:#4b5563;border:1px solid #d1d5db;border-radius:.375rem;padding:.5rem;width:100%}@media (max-width:500px){.login-module__phoneRow___oeNtq{grid-template-columns:1fr}}.login-module__fallbackCard___HdIk-{background:hsla(0,0%,100%,.04);border:1px solid hsla(0,0%,100%,.08);border-radius:12px;display:flex;flex-direction:column;gap:14px;margin-top:18px;padding:18px}.login-module__fallbackHeader___-il2v{color:#f3f4f6;font-size:.95rem;font-weight:600}.login-module__fallbackDescription___ea5EB{color:#9ca3af;font-size:.85rem;line-height:1.4}.login-module__fallbackActions___AD3ni{display:flex;flex-direction:column;gap:10px}.login-module__fallbackActionButton___lFgWf{background:rgba(0,0,0,.25);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;cursor:pointer;display:flex;flex-direction:column;padding:12px 14px;text-align:left;transition:all .15s ease}.login-module__fallbackActionButton___lFgWf:hover{background:hsla(0,0%,100%,.06);border-color:hsla(0,0%,100%,.15)}.login-module__actionTitle___ycrMp{color:#f9fafb;font-size:.9rem;font-weight:500}.login-module__actionSubtext___opaIV{color:#9ca3af;font-size:.75rem;margin-top:2px}.login-module__linkButton___5lsoe{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.8rem;margin-top:6px}.login-module__linkButton___5lsoe:hover{text-decoration:underline}");var Z="termsModal-module__overlay___-j6r5",Q="termsModal-module__modal___4PxZV",X="termsModal-module__header___B7wxb",ee="termsModal-module__title___Sucwt",oe="termsModal-module__closeBtn___evIs5",ne="termsModal-module__content___5BDhN",ie="termsModal-module__link___oPZrU";M(".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 re=({isOpen:n,onClose:i})=>{const r=s(null);return a(()=>{const e=e=>{"Escape"===e.key&&i()};return n&&(document.addEventListener("keydown",e),r.current?.focus()),()=>{document.removeEventListener("keydown",e)}},[n,i]),n?e("div",{className:Z,role:"dialog","aria-modal":"true","aria-labelledby":"terms-title",children:o("div",{className:Q,tabIndex:-1,ref:r,children:[o("div",{className:X,children:[e("h2",{id:"terms-title",className:ee,children:"SMS Terms & Conditions"}),e("button",{onClick:i,className:oe,children:"×"})]}),o("div",{className:ne,children:[o("p",{children:[e("strong",{children:"Effective Date:"})," June 01, 2025"]}),e("p",{children:"By providing your phone number to SeamlessAuth, a Fells Code LLC product, you agree to receive SMS messages for identity verification, authentication, and account security."}),o("p",{children:[e("strong",{children:"1. Purpose:"})," SMS is used only for account security (OTP, MFA). No marketing messages."]}),o("p",{children:[e("strong",{children:"2. Frequency:"})," Based on login and account activity."]}),o("p",{children:[e("strong",{children:"3. Opt-Out:"})," Contact support@seamlessauth.com to opt out."]}),o("p",{children:[e("strong",{children:"4. Fees:"})," Message and data rates may apply."]}),o("p",{children:[e("strong",{children:"5. Supported Carriers:"})," Most major providers supported, delivery not guaranteed."]}),o("p",{children:[e("strong",{children:"6. Privacy:"})," Your phone number is not shared or sold. See our Privacy Policy."]}),o("p",{children:[e("strong",{children:"7. Changes:"})," Terms may be updated with notice on this page."]}),o("p",{children:["Questions? Email us at"," ",e("a",{className:ie,href:"mailto:support@seamlessauth.com",children:"support@seamlessauth.com"}),"."]})]})]})}):null},te=[{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 ae({phone:n,setPhone:i,phoneError:r,setPhoneError:l}){const[s,d]=t(!1),[c,_]=t(te[0]);a(()=>{const e=function(){try{const e=Intl.DateTimeFormat().resolvedOptions().locale||"en-US",o=e.split("-")[1]?.toUpperCase()||"US";return te.find(e=>e.code===o)||te[0]}catch{return te[0]}}();_(e)},[]);return o("div",{className:E,children:[e("label",{id:"phone",className:A,children:"Phone Number"}),o("div",{className:V,children:[e("select",{value:c.code,onChange:e=>{const o=te.find(o=>o.code===e.target.value);if(o){_(o);const e=n.replace(/^\+\d+/,""),r=(new b).input(o.dialCode+e);i(r)}},className:D,children:te.map(e=>o("option",{value:e.code,children:[e.flag," (",e.dialCode,")"]},e.code))}),e("input",{"aria-labelledby":"phone",type:"tel",value:n,onChange:e=>{const o=e.target.value,n=o.startsWith(c.dialCode)?o:c.dialCode+o,t=(new b).input(n);i(t),r&&l("")},onBlur:()=>{if(n){const e=k(n),o=e?.isValid();l(o?"":"Please enter a valid phone number.")}},autoComplete:"off",placeholder:"(555) 123-4567",className:H})]}),o("p",{className:B,children:["By signing up, you agree to our"," ",e("button",{onClick:()=>d(!0),className:L,children:"SMS Terms & Conditions"}),"."]}),r&&e("p",{className:z,children:r}),e(re,{isOpen:s,onClose:()=>d(!1)})]})}const le=e=>{if("string"!=typeof e)return!1;const o=e.trim();if(o.length<3||o.length>320)return!1;const n=o.split("@");if(2!==n.length)return!1;const[i,r]=n;return!(!/^[A-Za-z0-9._%+-]+$/.test(i)||i.startsWith(".")||i.endsWith(".")||i.includes(".."))&&!(!/^[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(r)||r.startsWith("-")||r.endsWith("-")||r.startsWith(".")||r.endsWith(".")||r.includes(".."))},se=e=>{const o=y(e);return o?.isValid()||!1};async function de(){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 ce=({identifier:n,onMagicLink:i,onPhoneOtp:r,onPasskeyRetry:t})=>{const a=le(n),l=se(n);return o("div",{className:R,children:[e("div",{className:U,children:"Passkeys unavailable on this device"}),e("p",{className:q,children:"Choose another secure sign-in method."}),o("div",{className:K,children:[a&&o("button",{type:"button",className:J,onClick:i,children:[e("span",{className:W,children:"Email Magic Link"}),e("span",{className:$,children:"Send a secure sign-in link to your email"})]}),l&&o("button",{type:"button",className:J,onClick:r,children:[e("span",{className:W,children:"Text Message Code"}),e("span",{className:$,children:"Receive a one-time code via SMS"})]})]}),e("button",{type:"button",className:Y,onClick:t,children:"Try passkey anyway"})]})},_e=()=>{const i=d(),{apiHost:r,hasSignedInBefore:l,mode:s}=C(),{validateToken:c}=w(),[_,m]=t(""),[u,g]=t(""),[h,f]=t("register"),[y,b]=t(""),[k,v]=t(""),[x,P]=t(""),[T,M]=t(""),[L,V]=t(""),[D,H]=t(!1),[R,U]=t(!1),[q,K]=t(null),J=N({authMode:s,authHost:r});a(()=>{!async function(){const e=await de();H(e)}(),l&&f("login");const e=new URLSearchParams(window.location.search).get("bootstrapToken");e&&e.length>10&&(K(e),console.log("Bootstrap token detected in URL"))},[l]);const W=async()=>{try{const e=await J("/webAuthn/login/start",{method:"POST"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),n=await p({optionsJSON:o}),r=await J("/webAuthn/login/finish",{method:"POST",body:JSON.stringify({assertionResponse:n})});r.ok||console.error("Failed to verify passkey");const t=await r.json();if("Success"===t.message)return t.mfaLogin?void i("/mfaLogin"):(await c(),void i("/"));console.error("Passkey login failed:",t.message)}catch(e){console.error("Passkey login error:",e)}};return e("div",{className:S,children:o("div",{className:I,children:[e("h2",{className:O,children:"login"===h?"Sign In":"Create Account"}),e(n,{children:o("form",{onSubmit:async e=>{e.preventDefault(),"login"===h&&(async()=>{if(v(""),(await J("/login",{method:"POST",body:JSON.stringify({identifier:_,passkeyAvailable:D})})).ok)if(D)try{await W()}catch(e){console.error("Passkey login failed",e),U(!0)}else U(!0);else v("Failed to send login link. Please try again.")})(),"register"===h&&(async()=>{v("");try{const e=await J("/registration/register",{method:"POST",body:JSON.stringify({email:u,phone:y,...q?{bootstrapToken:q}:{}})});if(!e.ok)return void v("Failed to register. Please try again.");"Success"===(await e.json()).message&&i("/verifyPhoneOTP"),v("An unexpected error occured. Try again. If the problem persists, try resetting your password")}catch(e){console.error("Unexpected login error",e),v("An unexpected error occured. Try again. If the problem persists, try resetting your password")}})()},children:["login"===h&&o("div",{className:E,children:[e("label",{htmlFor:"identifier",className:A,children:"Email Address / Phone Number"}),e("input",{id:"identifier",type:"text",value:_,onChange:e=>{const o=e.target.value;m(o)},autoComplete:"off",placeholder:"Email or Phone Number",className:j,onBlur:()=>{if(_){const e=le(_)||se(_);V(e?"":"Please enter a valid email or phone number")}},required:!0}),e("p",{className:B,children:"Phone numbers must include a country code e.g. +1"}),R&&e(ce,{identifier:_,onMagicLink:async()=>{try{if(!(await J("/magic-link",{method:"GET"})).ok)return void v("Failed to send magic link.");i("/magic-link-sent")}catch(e){console.error(e),v("Failed to send magic link.")}},onPhoneOtp:async()=>{try{if(!(await J("/login/phone-otp",{method:"POST",body:JSON.stringify({identifier:_})})).ok)return void v("Failed to send OTP.");i("/verifyPhoneOTP")}catch(e){console.error(e),v("Failed to send OTP.")}},onPasskeyRetry:W}),L&&e("p",{className:z,children:L})]}),"register"===h&&o(n,{children:[o("div",{className:E,children:[e("label",{htmlFor:"email",className:A,children:"Email Address"}),e("input",{id:"email",type:"email",value:u,onChange:e=>{const o=e.target.value;g(o)},autoComplete:"off",className:j,onBlur:()=>{if(u){const e=le(u);M(e?"":"Please enter a valid email")}},required:!0}),T&&e("p",{className:z,children:T})]}),e(ae,{phone:y,setPhone:b,phoneError:x,setPhoneError:P})]}),e("button",{type:"submit",className:F,disabled:!("login"===h&&_?le(_)||se(_):le(u)&&se(y)),children:"login"===h?"Login":"Register"}),k&&e("p",{className:z,children:k}),e("button",{type:"button",onClick:()=>f("login"===h?"register":"login"),className:G,children:"login"===h?"Don't have an account? Create one":"Already have an account? Sign in"})]})})]})})};var me="passKeyLogin-module__container___IUKxF",ue="passKeyLogin-module__card___2sKM1",ge="passKeyLogin-module__title___HZxvc",pe="passKeyLogin-module__button___FvR4I";M(".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 he=()=>{const n=d(),{apiHost:i,mode:r}=C(),{validateToken:t}=w(),a=N({authMode:r,authHost:i});return e("div",{className:me,children:o("div",{className:ue,children:[e("h2",{className:ge,children:"Login with Passkey"}),e("button",{onClick:async()=>{try{const e=await a("/webAuthn/login/start",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)return void console.error("Something went wrong getting webauthn options");const o=await e.json(),i=await p({optionsJSON:o}),r=await a("/webAuthn/login/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assertionResponse:i}),credentials:"include"});r.ok||console.error("Failed to verify passkey");const l=await r.json();if("Success"===l.message)return l.mfaLogin&&n("/mfaLogin"),await t(),void n("/");console.error("Passkey login failed")}catch{console.error("Passkey login error")}},className:pe,children:"Use Passkey"})]})})};var fe="registerPasskey-module__container___jqEh8",ye="registerPasskey-module__card___MJAyC",be="registerPasskey-module__loading___Q4i1x",ke="registerPasskey-module__spinner___V1nhd",ve="registerPasskey-module__supported___ihTih",xe="registerPasskey-module__title___vn2Qu",we="registerPasskey-module__description___AWmO-",Ne="registerPasskey-module__button___D3b4B",Pe="registerPasskey-module__message___RiOw-",Ce="registerPasskey-module__success___HP5aX",Te="registerPasskey-module__error___hGiqE";M(".registerPasskey-module__container___jqEh8{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.registerPasskey-module__card___MJAyC{background-color:#1f2937;border-radius:1rem;box-shadow:0 4px 20px rgba(0,0,0,.4);max-width:400px;padding:1.5rem;width:100%}.registerPasskey-module__loading___Q4i1x{align-items:center;background-color:#f9fafb;border-radius:.75rem;box-shadow:0 2px 8px rgba(0,0,0,.1);color:#374151;display:flex;font-weight:500;gap:.75rem;justify-content:center;padding:1.5rem}.registerPasskey-module__spinner___V1nhd{animation:registerPasskey-module__spin___oYcsC 1s linear infinite;border-color:#3b82f6 transparent;border-radius:9999px;border-style:solid;border-width:2px;height:1.5rem;width:1.5rem}@keyframes registerPasskey-module__spin___oYcsC{to{transform:rotate(1turn)}}.registerPasskey-module__supported___ihTih{background-color:#ecfdf5;border-radius:.75rem;box-shadow:0 2px 12px rgba(0,0,0,.1);color:#065f46;padding:1.25rem}.registerPasskey-module__title___vn2Qu{font-size:1.125rem;font-weight:600;margin-bottom:.5rem}.registerPasskey-module__description___AWmO-{margin-bottom:1rem}.registerPasskey-module__button___D3b4B{background-color:#059669;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__button___D3b4B:hover{background-color:#047857}.registerPasskey-module__message___RiOw-{font-size:.875rem;margin-top:1rem}.registerPasskey-module__success___HP5aX{color:#6ee7b7}.registerPasskey-module__error___hGiqE{color:#f87171}");var Me="deviceNameModal-module__overlay___fmdPd",Se="deviceNameModal-module__modal___uoEda",Ie="deviceNameModal-module__description___-HMTA",Oe="deviceNameModal-module__input___4vQMI",Ee="deviceNameModal-module__actions___KXw7b",Ae="deviceNameModal-module__primary___9Ozlk",je="deviceNameModal-module__secondary___HILhc";M(".deviceNameModal-module__overlay___fmdPd{align-items:center;background:rgba(0,0,0,.45);display:flex;inset:0;justify-content:center;position:fixed;z-index:1000}.deviceNameModal-module__modal___uoEda{background:#1f2937;border-radius:12px;box-shadow:0 20px 40px rgba(0,0,0,.15);color:#fff;max-width:420px;padding:24px;width:100%}.deviceNameModal-module__description___-HMTA{color:#fff;font-size:14px;margin-bottom:16px}.deviceNameModal-module__input___4vQMI{border:1px solid #ddd;border-radius:8px;font-size:14px;margin-bottom:20px;padding:10px 12px;width:100%}.deviceNameModal-module__actions___KXw7b{display:flex;gap:10px;justify-content:flex-end}.deviceNameModal-module__primary___9Ozlk{background:#2563eb;border:none;border-radius:8px;color:#fff;cursor:pointer;padding:8px 14px}.deviceNameModal-module__secondary___HILhc{background:transparent;border:1px solid #ccc;border-radius:8px;cursor:pointer;padding:8px 14px}");const Be=({isOpen:n,onCancel:i,onConfirm:r})=>{const[a,l]=t("");return n?e("div",{className:Me,children:o("div",{className:Se,children:[e("h3",{children:"Name This Device"}),e("p",{className:Ie,children:"Give this passkey a friendly name so you can recognize it later."}),e("input",{type:"text",placeholder:"e.g., MacBook Pro, iPhone, YubiKey",value:a,onChange:e=>l(e.target.value),className:Oe,autoFocus:!0}),o("div",{className:Ee,children:[e("button",{onClick:i,className:je,children:"Cancel"}),e("button",{onClick:()=>r(a.trim()),disabled:!a.trim(),className:Ae,children:"Continue"})]})]})}):null},ze=()=>{const{apiHost:i,mode:r}=C(),{validateToken:l}=w(),s=d(),[c,_]=t("idle"),[m,u]=t(""),[g,p]=t(!1),[y,b]=t(!1),[k,v]=t(null),x=N({authMode:r,authHost:i});a(()=>{!async function(){const e=await de();p(e)}()},[]);const P=async(e,o)=>{if(!(await x("/webAuthn/register/finish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attestationResponse:e,metadata:o}),credentials:"include"})).ok)throw new Error("Verification failed");await l()};return o(n,{children:[e("div",{className:fe,children:e("div",{className:ye,children:o("div",g?{className:ve,children:[e("h2",{className:xe,children:"Secure Your Account with a Passkey"}),e("p",{className:we,children:"Your device supports passkeys! Register one to skip passwords forever."}),e("button",{onClick:()=>{const{platform:e,browser:o,deviceInfo:n}=function(){const e=navigator.userAgent.toLowerCase();let o="unknown",n="unknown";return/iphone|ipad|ipod/.test(e)?o="ios":/android/.test(e)?o="android":/mac os/.test(e)?o="mac":/windows/.test(e)?o="windows":/linux/.test(e)&&(o="linux"),/chrome/.test(e)&&(n="chrome"),/safari/.test(e)&&!/chrome/.test(e)&&(n="safari"),/firefox/.test(e)&&(n="firefox"),/edg/.test(e)&&(n="edge"),{platform:o,browser:n,deviceInfo:`${o} • ${n}`}}();v({platform:e,browser:o,deviceInfo:n}),b(!0)},disabled:"loading"===c,className:Ne,children:"loading"===c?"Registering...":"Register Passkey"}),m&&e("p",{className:`${Pe} ${"success"===c?Ce:Te}`,children:m})]}:{className:be,children:[e("div",{className:ke}),e("span",{children:"Checking for Passkey Support..."})]})})}),e(Be,{isOpen:y,onCancel:()=>{b(!1),v(null)},onConfirm:async e=>{if(!k)return;const{platform:o,browser:n,deviceInfo:i}=k;_("loading");try{const r=await x("/webAuthn/register/start",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!r.ok)throw new Error("Failed to fetch challenge");const t=await r.json();let a;try{a=await h({optionsJSON:t})}catch(e){if(e instanceof f)throw new Error(e.name);throw e}await P(a,{friendlyName:e,platform:o,browser:n,deviceInfo:i}),_("success"),u("Passkey registered successfully."),s("/")}catch(e){console.error(e),_("error"),u("Error registering passkey.")}finally{b(!1),v(null)}}})]})};var Fe="verifyOTP-module__container___wgoDE",Ge="verifyOTP-module__card___3cs2p",Le="verifyOTP-module__title___fZ-1d",Ve="verifyOTP-module__subtitle___dGSu3",De="verifyOTP-module__error___GEtlG",He="verifyOTP-module__success___46TjG",Re="verifyOTP-module__form___jiGG-",Ue="verifyOTP-module__label___Zq5Mi",qe="verifyOTP-module__timer___smq-a",Ke="verifyOTP-module__resend___PlmkG",Je="verifyOTP-module__button___8pIuO",We="verifyOTP-module__toggle___wbzVa";M(".verifyOTP-module__container___wgoDE{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyOTP-module__card___3cs2p{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyOTP-module__title___fZ-1d{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyOTP-module__subtitle___dGSu3{color:#9ca3af;font-size:.875rem;margin-bottom:1.5rem;text-align:center}.verifyOTP-module__error___GEtlG{color:#f87171;margin-bottom:1rem;text-align:center}.verifyOTP-module__success___46TjG{color:#34d399;margin-bottom:.75rem;text-align:center}.verifyOTP-module__form___jiGG-{display:flex;flex-direction:column;gap:1rem}.verifyOTP-module__label___Zq5Mi{color:#d1d5db;display:block;font-size:.875rem;margin-bottom:.25rem}.verifyOTP-module__timer___smq-a{color:#facc15;font-size:.875rem}.verifyOTP-module__input___yqIXM{background-color:#374151;border:1px solid #4b5563;border-radius:.375rem;color:#fff;outline:none;padding:.5rem;width:100%}.verifyOTP-module__input___yqIXM:focus{box-shadow:0 0 0 2px #3b82f6}.verifyOTP-module__resend___PlmkG{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.75rem;margin-top:.25rem;text-decoration:underline}.verifyOTP-module__resend___PlmkG:hover{color:#3b82f6}.verifyOTP-module__button___8pIuO{background-color:#2563eb;border:none;border-radius:.375rem;color:#fff;cursor:pointer;padding:.5rem;transition:background-color .2s;width:100%}.verifyOTP-module__button___8pIuO:hover{background-color:#1d4ed8}.verifyOTP-module__toggle___wbzVa{background:none;border:none;color:#60a5fa;cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}");var $e="otpInput-module__otpContainer___MUjby",Ye="otpInput-module__otpInput___3YMVm";M(".otpInput-module__otpContainer___MUjby{display:flex;gap:8px;justify-content:center;margin-top:8px}.otpInput-module__otpInput___3YMVm{background:#374151;border:1px solid #4b5563;border-radius:8px;color:#fff;font-size:1.2rem;height:48px;text-align:center;transition:border-color .15s ease,box-shadow .15s ease;width:42px}.otpInput-module__otpInput___3YMVm:focus{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.25);outline:none}");const Ze=({length:o=6,value:n,inputMode:i="numeric",onChange:r,name:t="otp"})=>{const a=s([]),l=n.split("").concat(Array(o).fill("")).slice(0,o),d=(e,o)=>{var n;if(o.length>1)c(e,o);else if(!o||(n=o,"numeric"===i?/^\d$/.test(n):/^[a-zA-Z]$/.test(n))){const n=[...l];n[e]=o;const i=n.join("");r(i),o&&a.current[e+1]&&a.current[e+1]?.focus()}},c=(e,n)=>{let t=n;t="numeric"===i?n.replace(/\D/g,""):n.replace(/[^a-zA-Z]/g,"");const s=t.slice(0,o).split(""),d=[...l];s.forEach((n,i)=>{e+i<o&&(d[e+i]=n)}),r(d.join("")),a.current[Math.min(e+s.length,o-1)]?.focus()};return e("div",{className:$e,role:"group","aria-label":"One-time password input",onPaste:e=>{e.preventDefault(),c(0,e.clipboardData.getData("text"))},children:l.map((n,s)=>e("input",{ref:e=>a.current[s]=e,type:"text",inputMode:"numeric"===i?"numeric":"text",autoComplete:"one-time-code",name:`${t}-${s}`,maxLength:1,value:n,className:Ye,onChange:e=>d(s,e.target.value),onKeyDown:e=>((e,n)=>{if("Backspace"===n.key){n.preventDefault();const o=[...l];l[e]?(o[e]="",r(o.join(""))):e>0&&(o[e-1]="",r(o.join("")),a.current[e-1]?.focus())}"ArrowLeft"===n.key&&e>0&&a.current[e-1]?.focus(),"ArrowRight"===n.key&&e<o-1&&a.current[e+1]?.focus()})(s,e),"aria-label":`Digit ${s+1}`},s))})},Qe=()=>{const n=d(),{apiHost:i,mode:r}=C(),[l,s]=t(""),[c,_]=t(null),[m,u]=t(""),[g,p]=t(!1),[h,f]=t(""),[y,b]=t(300),k=N({authMode:r,authHost:i}),v=async()=>{p(!0);try{if(!c){(await k("/otp/verify-phone-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:l}),credentials:"include"})).ok?_(!0):u("Verification failed.")}}catch(e){console.error(e),u("Verification failed.")}p(!1)},x=async()=>{f(""),await(async()=>{u("");const e=await k("/otp/generate-phone-otp",{method:"GET",headers:{"Content-Type":"application/json"}}),o=await e.json();e.ok?(o.token&&localStorage.setItem("token",o.token),f("Verification SMS has been resent.")):u("Failed to send SMS code. If this persists, refresh the page and try again.")})(),f("Verification SMS has been resent.")};return a(()=>{const e=setInterval(()=>{b(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{c&&(async()=>{(await k("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}})).ok?n("/verifyEmailOTP"):u("Failed to send Email code. If this persists, refresh the page and try registering again.")})()},[c,n,k]),e("div",{className:Fe,children:o("div",{className:Ge,children:[e("h2",{className:Le,children:"Verify Your Phone Number"}),e("p",{className:Ve,children:"Enter the code sent to your phone number."}),m&&e("p",{className:De,children:m}),h&&e("p",{className:He,children:h}),o("form",{onSubmit:async e=>{if(e.preventDefault(),u(""),6===l.length){p(!0);try{v()}catch{u("Unexpected error occurred.")}finally{p(!1)}}else u("Please enter a valid code.")},className:Re,children:[o("div",{children:[o("label",{htmlFor:"phoneCode",className:Ue,children:["Phone Verification Code ",(P=c,!0===P?e("span",{className:"text-green-400 ml-2",children:"✅"}):!1===P?e("span",{className:"text-red-400 ml-2",children:"❌"}):null)," -"," ",o("span",{className:qe,children:["Code expires in: ",(w=y,`${Math.floor(w/60).toString().padStart(2,"0")}:${(w%60).toString().padStart(2,"0")}`)]})]}),e(Ze,{length:6,value:l,onChange:s}),e("button",{type:"button",onClick:()=>x(),className:Ke,children:"Resend code to phone"})]}),e("button",{type:"submit",className:Je,children:g?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>n("/login"),className:We,children:"Back to login"})]})]})});var w,P},Xe=()=>{const n=d(),{apiHost:i,mode:r}=C(),{validateToken:l}=w(),[s,c]=t(!1),[_,m]=t(""),[u,g]=t(300),[p,h]=t(""),[f,y]=t(""),[b,k]=t(!1),v=N({authMode:r,authHost:i});return a(()=>{const e=setInterval(()=>{g(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),a(()=>{!async function(){const e=await de();k(e)}()},[]),e("div",{className:Fe,children:o("div",{className:Ge,children:[e("h2",{className:Le,children:"Verify Your Email"}),e("p",{className:Ve,children:"We sent you a verification email. Enter the code below."}),p&&e("p",{className:De,children:p}),f&&e("p",{className:He,children:f}),o("form",{onSubmit:async e=>{if(e.preventDefault(),h(""),6===_.length){c(!0);try{if(!(await v("/otp/verify-email-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({verificationToken:_}),credentials:"include"})).ok)return void h("Verification failed.");b?n("/registerPasskey"):(await l(),n("/"))}catch(e){console.error(e),h("Verification failed.")}finally{c(!1)}}else h("Please enter a valid code.")},className:Re,children:[o("div",{children:[o("label",{htmlFor:"emailCode",className:Ue,children:["Email Verification Code",o("span",{className:qe,children:[" ","— Code expires in ",(x=u,`${Math.floor(x/60).toString().padStart(2,"0")}:${(x%60).toString().padStart(2,"0")}`)]})]}),e(Ze,{length:6,value:_,onChange:m,inputMode:"text"}),e("button",{type:"button",onClick:async()=>{h(""),y("");(await v("/otp/generate-email-otp",{method:"GET",headers:{"Content-Type":"application/json"}})).ok?y("Verification email has been resent."):h("Failed to send Email code. If this persists, refresh the page and try again.")},className:Ke,children:"Resend code to email"})]}),e("button",{type:"submit",className:Je,disabled:s,children:s?"Verifying...":"Verify & Continue"}),e("button",{type:"button",onClick:()=>n("/login"),className:We,children:"Back to login"})]})]})});var x};var eo={container:"verifyMagiclink-module__container___qrSXf",card:"verifyMagiclink-module__card___niKgr",title:"verifyMagiclink-module__title___SumxD",verificationContent:"verifyMagiclink-module__verificationContent___NdsS0",spinner:"verifyMagiclink-module__spinner___lnW1k",successIcon:"verifyMagiclink-module__successIcon___XjFEM",checkIcon:"verifyMagiclink-module__checkIcon___I0JOP",successText:"verifyMagiclink-module__successText___lO5Qq"};M(".verifyMagiclink-module__container___qrSXf{align-items:center;color:#fff;display:flex;justify-content:center;padding:1rem}.verifyMagiclink-module__card___niKgr{background-color:#1f2937;border-radius:.5rem;box-shadow:0 0 10px rgba(0,0,0,.3);max-width:28rem;padding:1.5rem;width:100%}.verifyMagiclink-module__title___SumxD{color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyMagiclink-module__verificationContent___NdsS0{align-items:center;display:flex;flex-direction:column;gap:14px;margin:20px 0}.verifyMagiclink-module__spinner___lnW1k{animation:verifyMagiclink-module__spin___2lGzj .9s linear infinite;border:3px solid hsla(0,0%,100%,.15);border-radius:50%;border-top-color:#60a5fa;height:28px;width:28px}.verifyMagiclink-module__successIcon___XjFEM{align-items:center;background:rgba(16,185,129,.15);border-radius:50%;display:flex;height:36px;justify-content:center;width:36px}.verifyMagiclink-module__checkIcon___I0JOP{animation:verifyMagiclink-module__checkPop___-3qJu .25s ease-out;color:#34d399;height:22px;width:22px}.verifyMagiclink-module__successText___lO5Qq{color:#34d399;font-size:.9rem}@keyframes verifyMagiclink-module__checkPop___-3qJu{0%{opacity:0;transform:scale(.6)}80%{transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@keyframes verifyMagiclink-module__spin___2lGzj{to{transform:rotate(1turn)}}");const oo=()=>{const[n]=c(),i=d(),r=n.get("token"),{apiHost:l,mode:s}=C(),[_,m]=t(""),[u,g]=t(""),p=N({authMode:s,authHost:l});return a(()=>{r?(async()=>{if(!(await p(`/magic-link/verify/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}})).ok)return console.error("Failed to verify token"),void m("Failed to verify token");new BroadcastChannel("seamless-auth").postMessage({type:"MAGIC_LINK_AUTH_SUCCESS"}),g("You have been verified on the device and browser that initiated this request"),setTimeout(()=>{i("/")},900)})():(m("Missing token for verification."),console.error("No token found",r))},[r,p,i]),e("div",{className:eo.container,children:o("div",{className:eo.card,children:[e("h1",{className:eo.title,children:"Verifying your login"}),o("div",{className:eo.verificationContent,children:[!u&&!_&&e("div",{className:eo.spinner}),u&&e("div",{className:eo.successIcon,children:e("svg",{viewBox:"0 0 24 24",className:eo.checkIcon,fill:"none",stroke:"currentColor",strokeWidth:"2",children:e("path",{d:"M5 13l4 4L19 7"})})}),!u&&!_&&e("p",{className:eo.helperText,children:"Please wait while we securely verify your sign-in link."}),u&&e("p",{className:eo.successText,children:"Login verified. Redirecting…"}),_&&e("p",{className:eo.error,children:_})]})]})})};var no="magiclink-module__container___45zcA",io="magiclink-module__card___Au9oN",ro="magiclink-module__iconWrapper___k5ndr",to="magiclink-module__mailIcon___Pwb7q",ao="magiclink-module__iconRing___bdLvf",lo="magiclink-module__heading___b9cre",so="magiclink-module__message___kiVFj",co="magiclink-module__identifier___JtcFM",_o="magiclink-module__helperText___7Mlfh",mo="magiclink-module__actions___64I-3",uo="magiclink-module__secondaryButton___BntAI",go="magiclink-module__cooldown___Ib4rm",po="magiclink-module__linkButton___maJiv";M(".magiclink-module__container___45zcA{align-items:center;color:#fff;display:flex;justify-content:center}.magiclink-module__card___Au9oN{background-color:#1f2937;border-radius:.75rem;box-shadow:0 10px 25px rgba(0,0,0,.25);max-width:420px;padding:2.5rem 2rem;text-align:center;width:100%}.magiclink-module__iconWrapper___k5ndr{display:flex;justify-content:center;margin-bottom:1.25rem;position:relative}.magiclink-module__mailIcon___Pwb7q{color:#a5b4fc;height:38px;width:38px;z-index:2}.magiclink-module__iconRing___bdLvf{animation:magiclink-module__pulse___YGm-I 2s infinite;background:rgba(99,102,241,.15);border-radius:50%;height:72px;position:absolute;width:72px}@keyframes magiclink-module__pulse___YGm-I{0%{opacity:.8;transform:scale(.6)}70%{opacity:0;transform:scale(1.4)}to{opacity:0}}.magiclink-module__heading___b9cre{font-size:1.55rem;font-weight:600;margin-bottom:.75rem}.magiclink-module__message___kiVFj{color:#d1d5db;font-size:.95rem;line-height:1.4;margin-bottom:1rem}.magiclink-module__identifier___JtcFM{background:hsla(0,0%,100%,.05);border-radius:6px;display:inline-block;font-size:1rem;font-weight:600;margin-bottom:1rem;padding:.45rem .6rem}.magiclink-module__helperText___7Mlfh{color:#9ca3af;font-size:.85rem;line-height:1.4;margin-bottom:.6rem}.magiclink-module__actions___64I-3{display:flex;flex-direction:column;gap:.6rem;margin-top:1.6rem}.magiclink-module__secondaryButton___BntAI{background:#111827;border:1px solid #374151;border-radius:8px;color:#fff;cursor:pointer;font-weight:500;padding:.65rem}.magiclink-module__secondaryButton___BntAI:hover:not(:disabled){background:#1f2937}.magiclink-module__secondaryButton___BntAI:disabled{cursor:not-allowed;opacity:.5}.magiclink-module__cooldown___Ib4rm{color:#9ca3af;font-size:.8rem}.magiclink-module__linkButton___maJiv{background:none;border:none;color:#a5b4fc;cursor:pointer;font-size:.85rem;margin-top:.4rem}.magiclink-module__linkButton___maJiv:hover{text-decoration:underline}");const ho=()=>{const{apiHost:n,mode:i}=C(),{validateToken:r}=w(),l=d(),s=_(),c=N({authMode:i,authHost:n}),m=s.state?.identifier,[u,g]=t(30);a(()=>{const e=setInterval(()=>{g(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]);return a(()=>{const e=new BroadcastChannel("seamless-auth");return e.onmessage=async e=>{if("MAGIC_LINK_AUTH_SUCCESS"===e.data?.type){200===(await c("/magic-link/check",{method:"GET",headers:{"Content-Type":"application/json"}})).status&&(await r(),l("/"))}},()=>{e.close()}},[c,l,r]),a(()=>{const e=setInterval(async()=>{try{200===(await c("/magic-link/check",{method:"GET",headers:{"Content-Type":"application/json"}})).status&&(await r(),l("/"))}catch{}},5e3);return()=>clearInterval(e)},[n,r,l]),e("div",{className:no,children:o("div",{className:io,children:[o("div",{className:ro,children:[e("div",{className:ao}),o("svg",{className:to,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e("path",{d:"M4 6h16v12H4z"}),e("path",{d:"m4 6 8 6 8-6"})]})]}),e("h2",{className:lo,children:"Check your email"}),e("p",{className:so,children:"If an account exists for this address, we sent a secure sign-in link."}),e("div",{className:co,children:m}),e("p",{className:_o,children:"Open the email and click the link to finish signing in."}),e("p",{className:_o,children:"Didn’t receive anything? Check your spam folder or try creating a new account."}),o("div",{className:mo,children:[e("button",{className:uo,disabled:u>0,onClick:async()=>{u>0||(await c("/magic-link",{method:"GET",headers:{"Content-Type":"application/json"}}),g(30))},children:"Resend link"}),u>0&&o("div",{className:go,children:["Available in ",u,"s"]}),e("button",{className:po,onClick:()=>l("/login"),children:"Change email or phone"})]})]})})},fo=()=>o(m,{children:[e(u,{path:"/login",element:e(_e,{})}),e(u,{path:"/passKeyLogin",element:e(he,{})}),e(u,{path:"/verifyPhoneOTP",element:e(Qe,{})}),e(u,{path:"/verifyEmailOTP",element:e(Xe,{})}),e(u,{path:"/verify-magiclink",element:e(oo,{})}),e(u,{path:"/registerPasskey",element:e(ze,{})}),e(u,{path:"/magic-link-sent",element:e(ho,{})}),e(u,{path:"*",element:e(g,{to:"/login",replace:!0})})]});export{T as AuthProvider,fo as AuthRoutes,C 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/components/LoadingSpinner.tsx","../src/AuthProvider.tsx","../src/hooks/usePreviousSignIn.ts","../node_modules/style-inject/dist/style-inject.es.js","../src/components/TermsModal.tsx","../src/components/phoneInput.tsx","../src/utils.ts","../src/components/AuthFallbackOptions.tsx","../src/views/Login.tsx","../src/views/PassKeyLogin.tsx","../src/components/DeviceNameModal.tsx","../src/views/PassKeyRegistration.tsx","../src/components/OtpInput.tsx","../src/views/PhoneRegistration.tsx","../src/views/EmailRegistration.tsx","../src/views/VerifyMagicLink.tsx","../src/components/MagicLinkSent.tsx","../src/AuthRoutes.tsx"],"sourcesContent":[null,null,null,null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["InternalAuthContext","createContext","undefined","InternalAuthProvider","value","children","_jsx","Provider","useInternalAuth","context","useContext","Error","createFetchWithAuth","opts","authMode","authHost","async","input","init","url","startsWith","requestInit","credentials","headers","response","fetch","ok","console","warn","status","LoadingSpinner","className","AuthContext","useAuth","AuthProvider","apiHost","autoDetectPreviousSignin","mode","user","setUser","useState","setCredentials","isAuthenticated","setIsAuthenticated","loading","setLoading","token","setToken","hasSignedInBefore","markSignedIn","storageKey","setHasSignedInBefore","useEffect","localStorage","getItem","setItem","usePreviousSignIn","fetchWithAuth","logout","useCallback","method","error","validateToken","json","_jsxs","deleteUser","hasRole","role","roles","includes","updateCredential","credential","body","JSON","stringify","friendlyName","id","deleteCredential","credentialId","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TermsModal","isOpen","onClose","modalRef","useRef","handleKeyDown","e","key","addEventListener","current","focus","removeEventListener","styles","tabIndex","onClick","href","countries","code","name","dialCode","flag","PhoneInputWithCountryCode","phone","setPhone","phoneError","setPhoneError","showModal","setShowModal","selectedCountry","setSelectedCountry","defaultCountry","locale","Intl","DateTimeFormat","resolvedOptions","countryCode","split","toUpperCase","find","c","getDefaultCountry","onChange","country","target","stripped","replace","newPhone","AsYouType","map","raw","full","formatted","onBlur","parsed","parsePhoneNumberFromString","isValid","autoComplete","placeholder","isValidEmail","email","normalized","trim","length","parts","localPart","domainPart","test","endsWith","isValidPhoneNumber","phoneNumber","isPasskeySupported","window","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","AuthFallbackOptions","identifier","onMagicLink","onPhoneOtp","onPasskeyRetry","showMagicLink","showPhoneOtp","Login","navigate","useNavigate","setIdentifier","setEmail","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","passkeyAvailable","setPasskeyAvailable","showFallbackOptions","setShowFallbackOptions","supported","checkSupport","handlePasskeyLogin","options","startAuthentication","optionsJSON","verificationResponse","assertionResponse","verificationResult","message","mfaLogin","_Fragment","onSubmit","preventDefault","err","login","register","htmlFor","required","disabled","PassKeyLogin","DeviceNameModal","onCancel","onConfirm","setValue","autoFocus","PasskeyRegistration","setStatus","setMessage","showDeviceModal","setShowDeviceModal","pendingMetadata","setPendingMetadata","verifyPassKey","attResp","metadata","attestationResponse","platform","browser","deviceInfo","ua","navigator","userAgent","toLowerCase","parseUserAgent","challengeRes","startRegistration","WebAuthnError","OtpInput","inputs","values","concat","Array","fill","slice","onPaste","pasted","clipboardData","getData","digit","i","el","inputMode","maxLength","index","char","newValue","substring","handleChange","onKeyDown","PhoneRegistration","phoneOtp","setPhoneOtp","phoneVerified","setPhoneVerified","setError","resendMsg","setResendMsg","phoneTimeLeft","setPhoneTimeLeft","verifyPhoneOTP","verificationToken","handleResend","data","onResendPhone","interval","setInterval","prev","clearInterval","nextStep","verified","seconds","Math","floor","toString","padStart","EmailRegistration","emailOtp","setEmailOtp","emailTimeLeft","setEmailTimeLeft","VerifyMagicLink","searchParams","useSearchParams","get","successMsg","setSuccessMsg","BroadcastChannel","postMessage","setTimeout","verify","container","card","title","verificationContent","spinner","successIcon","viewBox","checkIcon","stroke","strokeWidth","d","helperText","successText","MagicLinkSent","location","useLocation","state","cooldown","setCooldown","timer","channel","onmessage","event","close","AuthRoutes","Routes","Route","path","element","Navigate","to"],"mappings":"meAOA,MAAMA,EAAsBC,OAAmDC,GAElEC,EAAuB,EAClCC,QACAC,cAMEC,EAACN,EAAoBO,SAAQ,CAACH,MAAOA,EAAKC,SAAGA,IAKpCG,EAAkB,KAC7B,MAAMC,EAAUC,EAAWV,GAC3B,IAAKS,EACH,MAAM,IAAIE,MAAM,4DAElB,OAAOF,GCpBIG,EAAuBC,IAClC,MAAMC,SAAEA,EAAQC,SAAEA,GAAaF,EAE/B,OAAOG,eACLC,EACAC,GAEA,MAEMC,EAAM,GAAGJ,IAFW,WAAbD,EAAwB,OAAS,KAEbG,EAAMG,WAAW,KAAOH,EAAQ,IAAIA,MAE/DI,EAA2B,IAC5BH,EACHI,YAAa,UACbC,QAAS,CACP,eAAgB,sBACbL,GAAMK,UAIPC,QAAiBC,MAAMN,EAAKE,GAElC,GAAIG,EAASE,GAAI,OAAOF,EAGxB,MADAG,QAAQC,KAAK,qBAAsBJ,EAASK,OAAQV,GAC9C,IAAIR,MAAM,8BAA8BQ,IAChD,GC/BIW,EAA2B,IAE7BxB,EAAA,MAAA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QAAS,CACP,eAAgB,sBAIpB0S,EAAY,MAqFW5T,SAAA,gBAKhB2T,EAAW,GACVhQ,EAAA,MAAA,CAAKjC,UAAW4E,6BAA+BqN,EAAQ,OAGzD1T,EAAA,SAAA,CAAQyB,UAAW4E,GAAmBE,QAAS,IAAMoE,EAAS,UAAS5K,SAAA,mCC7HpEkU,GAAa,IACxBvQ,EAACwQ,EAAM,CAAAnU,SAAA,CACLC,EAACmU,EAAK,CAACC,KAAK,SAASC,QAASrU,EAAC0K,GAAK,MACpC1K,EAACmU,EAAK,CAACC,KAAK,gBAAgBC,QAASrU,EAAC8M,GAAY,MAClD9M,EAACmU,EAAK,CAACC,KAAK,kBAAkBC,QAASrU,EAACgQ,GAAiB,CAAA,KACzDhQ,EAACmU,EAAK,CAACC,KAAK,kBAAkBC,QAASrU,EAAC0R,GAAiB,CAAA,KACzD1R,EAACmU,EAAK,CAACC,KAAK,oBAAoBC,QAASrU,EAAC+R,GAAe,CAAA,KACzD/R,EAACmU,EAAK,CAACC,KAAK,mBAAmBC,QAASrU,EAACoN,GAAmB,CAAA,KAC5DpN,EAACmU,EAAK,CAACC,KAAK,mBAAmBC,QAASrU,EAACsT,GAAa,CAAA,KACtDtT,EAACmU,EAAK,CAACC,KAAK,IAAIC,QAASrU,EAACsU,EAAQ,CAACC,GAAG,SAASjM,SAAO","x_google_ignoreList":[5]}
1
+ {"version":3,"file":"index.js","sources":["../src/context/InternalAuthContext.tsx","../src/fetchWithAuth.ts","../src/AuthProvider.tsx","../src/hooks/usePreviousSignIn.ts","../node_modules/style-inject/dist/style-inject.es.js","../src/components/TermsModal.tsx","../src/components/phoneInput.tsx","../src/utils.ts","../src/components/AuthFallbackOptions.tsx","../src/views/Login.tsx","../src/views/PassKeyLogin.tsx","../src/components/DeviceNameModal.tsx","../src/views/PassKeyRegistration.tsx","../src/components/OtpInput.tsx","../src/views/PhoneRegistration.tsx","../src/views/EmailRegistration.tsx","../src/views/VerifyMagicLink.tsx","../src/components/MagicLinkSent.tsx","../src/AuthRoutes.tsx"],"sourcesContent":[null,null,null,null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["InternalAuthContext","createContext","undefined","InternalAuthProvider","value","children","_jsx","Provider","useInternalAuth","context","useContext","Error","createFetchWithAuth","opts","authMode","authHost","async","input","init","url","startsWith","requestInit","credentials","headers","response","fetch","ok","console","warn","status","AuthContext","useAuth","AuthProvider","apiHost","autoDetectPreviousSignin","mode","user","setUser","useState","setCredentials","isAuthenticated","setIsAuthenticated","loading","setLoading","token","setToken","hasSignedInBefore","markSignedIn","storageKey","setHasSignedInBefore","useEffect","localStorage","getItem","setItem","usePreviousSignIn","fetchWithAuth","logout","useCallback","method","error","validateToken","json","deleteUser","hasRole","role","roles","includes","updateCredential","credential","body","JSON","stringify","friendlyName","id","deleteCredential","credentialId","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TermsModal","isOpen","onClose","modalRef","useRef","handleKeyDown","e","key","addEventListener","current","focus","removeEventListener","className","styles","_jsxs","tabIndex","onClick","href","countries","code","name","dialCode","flag","PhoneInputWithCountryCode","phone","setPhone","phoneError","setPhoneError","showModal","setShowModal","selectedCountry","setSelectedCountry","defaultCountry","locale","Intl","DateTimeFormat","resolvedOptions","countryCode","split","toUpperCase","find","c","getDefaultCountry","onChange","country","target","stripped","replace","newPhone","AsYouType","map","raw","full","formatted","onBlur","parsed","parsePhoneNumberFromString","isValid","autoComplete","placeholder","isValidEmail","email","normalized","trim","length","parts","localPart","domainPart","test","endsWith","isValidPhoneNumber","phoneNumber","isPasskeySupported","window","PublicKeyCredential","isUserVerifyingPlatformAuthenticatorAvailable","AuthFallbackOptions","identifier","onMagicLink","onPhoneOtp","onPasskeyRetry","showMagicLink","showPhoneOtp","Login","navigate","useNavigate","setIdentifier","setEmail","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","passkeyAvailable","setPasskeyAvailable","showFallbackOptions","setShowFallbackOptions","bootstrapToken","setBootstrapToken","supported","checkSupport","URLSearchParams","location","search","get","log","handlePasskeyLogin","options","startAuthentication","optionsJSON","verificationResponse","assertionResponse","verificationResult","message","mfaLogin","_Fragment","onSubmit","preventDefault","err","login","register","htmlFor","required","disabled","PassKeyLogin","DeviceNameModal","onCancel","onConfirm","setValue","autoFocus","PasskeyRegistration","setStatus","setMessage","showDeviceModal","setShowDeviceModal","pendingMetadata","setPendingMetadata","verifyPassKey","attResp","metadata","attestationResponse","platform","browser","deviceInfo","ua","navigator","userAgent","toLowerCase","parseUserAgent","challengeRes","startRegistration","WebAuthnError","OtpInput","inputMode","inputs","values","concat","Array","fill","slice","handleChange","index","char","handleBulkInput","newValueArr","newValue","join","cleaned","chars","forEach","i","Math","min","onPaste","clipboardData","getData","el","maxLength","onKeyDown","PhoneRegistration","phoneOtp","setPhoneOtp","phoneVerified","setPhoneVerified","setError","resendMsg","setResendMsg","phoneTimeLeft","setPhoneTimeLeft","verifyPhoneOTP","verificationToken","handleResend","data","onResendPhone","interval","setInterval","prev","clearInterval","nextStep","verified","seconds","floor","toString","padStart","EmailRegistration","emailOtp","setEmailOtp","emailTimeLeft","setEmailTimeLeft","VerifyMagicLink","searchParams","useSearchParams","successMsg","setSuccessMsg","BroadcastChannel","postMessage","setTimeout","verify","container","card","title","verificationContent","spinner","successIcon","viewBox","checkIcon","stroke","strokeWidth","d","helperText","successText","MagicLinkSent","useLocation","state","cooldown","setCooldown","timer","channel","onmessage","event","close","AuthRoutes","Routes","Route","path","element","Navigate","to"],"mappings":"meAaA,MAAMA,EAAsBC,OAAmDC,GAElEC,EAAuB,EAClCC,QACAC,cAMEC,EAACN,EAAoBO,SAAQ,CAACH,MAAOA,EAAKC,SAAGA,IAKpCG,EAAkB,KAC7B,MAAMC,EAAUC,EAAWV,GAC3B,IAAKS,EACH,MAAM,IAAIE,MAAM,4DAElB,OAAOF,GCpBIG,EAAuBC,IAClC,MAAMC,SAAEA,EAAQC,SAAEA,GAAaF,EAE/B,OAAOG,eACLC,EACAC,GAEA,MAEMC,EAAM,GAAGJ,IAFW,WAAbD,EAAwB,OAAS,KAEbG,EAAMG,WAAW,KAAOH,EAAQ,IAAIA,MAE/DI,EAA2B,IAC5BH,EACHI,YAAa,UACbC,QAAS,CACP,eAAgB,sBACbL,GAAMK,UAIPC,QAAiBC,MAAMN,EAAKE,GAElC,GAAIG,EAASE,GAAI,OAAOF,EAGxB,MADAG,QAAQC,KAAK,qBAAsBJ,EAASK,OAAQV,GAC9C,IAAIR,MAAM,8BAA8BQ,IAChD,GC0BF,MAAMW,EAAc7B,OAA2CC,GAMlD6B,EAAU,KACrB,MAAMtB,EAAUC,EAAWoB,GAC3B,IAAKrB,EACH,MAAM,IAAIE,MAAM,+CAElB,OAAOF,GAUIuB,EAA4C,EACvD3B,WACA4B,UACAC,4BAA2B,EAC3BC,OAAO,UAEP,MAAOC,EAAMC,GAAWC,EAAsB,OACvChB,EAAaiB,GAAkBD,EAAuB,KACtDE,EAAiBC,GAAsBH,GAAkB,IACzDI,EAASC,GAAcL,GAAkB,IACzCM,EAAOC,GAAYP,EAA2B,OAC/CQ,kBAAEA,EAAiBC,aAAEA,GCzFvB,SAA4BC,EAAa,qBAC7C,MAAOF,EAAmBG,GAAwBX,GAAS,GAoB3D,OAlBAY,EAAU,KACR,IAEe,SADAC,aAAaC,QAAQJ,IACbC,GAAqB,EAC5C,CAAE,MAEF,GACC,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,IAEpCnK,OAAGkG,UAAWC,GAAiBpG,SAAA,4DAI/BC,OAAGkG,UAAWC,GAAiBpG,SAAA,mFAI/BqG,SAAKF,UAAWC,aACdnG,EAAA,SAAA,CACEkG,UAAWC,GACXgH,SAAU+G,EAAW,EACrB5N,QA/FK5F,UACTwT,EAAW,UAETjR,EAAc,cAAe,CACjCG,OAAQ,MACRnC,QAAS,CACP,eAAgB,sBAIpBkT,EAAY,MAqFWpU,SAAA,gBAKhBmU,EAAW,GACV9N,EAAA,MAAA,CAAKF,UAAWC,6BAA+B+N,EAAQ,OAGzDlU,EAAA,SAAA,CAAQkG,UAAWC,GAAmBG,QAAS,IAAMoE,EAAS,UAAS3K,SAAA,mCC7HpE0U,GAAa,IACxBrO,EAACsO,EAAM,CAAA3U,SAAA,CACLC,EAAC2U,EAAK,CAACC,KAAK,SAASC,QAAS7U,EAACyK,GAAK,MACpCzK,EAAC2U,EAAK,CAACC,KAAK,gBAAgBC,QAAS7U,EAACoN,GAAY,MAClDpN,EAAC2U,EAAK,CAACC,KAAK,kBAAkBC,QAAS7U,EAAC2Q,GAAiB,CAAA,KACzD3Q,EAAC2U,EAAK,CAACC,KAAK,kBAAkBC,QAAS7U,EAACoS,GAAiB,CAAA,KACzDpS,EAAC2U,EAAK,CAACC,KAAK,oBAAoBC,QAAS7U,EAACyS,GAAe,CAAA,KACzDzS,EAAC2U,EAAK,CAACC,KAAK,mBAAmBC,QAAS7U,EAAC0N,GAAmB,CAAA,KAC5D1N,EAAC2U,EAAK,CAACC,KAAK,mBAAmBC,QAAS7U,EAAC+T,GAAa,CAAA,KACtD/T,EAAC2U,EAAK,CAACC,KAAK,IAAIC,QAAS7U,EAAC8U,EAAQ,CAACC,GAAG,SAAS1M,SAAO","x_google_ignoreList":[4]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamless-auth/react",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "description": "A drop-in authentication solution for modern React applications.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,6 +22,7 @@
22
22
  "scripts": {
23
23
  "build": "rollup -c",
24
24
  "test": "jest",
25
+ "coverage": "npm test -- --coverage",
25
26
  "lint": "eslint ./src",
26
27
  "format": "prettier --write .",
27
28
  "prepare": "husky",
@@ -60,7 +61,7 @@
60
61
  "@rollup/plugin-alias": "^5.1.1",
61
62
  "@rollup/plugin-commonjs": "^26.0.1",
62
63
  "@rollup/plugin-node-resolve": "^15.2.3",
63
- "@rollup/plugin-terser": "^0.4.4",
64
+ "@rollup/plugin-terser": "^1.0.0",
64
65
  "@rollup/plugin-typescript": "^11.1.6",
65
66
  "@testing-library/jest-dom": "^6.9.1",
66
67
  "@testing-library/react": "^16.3.0",
@@ -90,6 +91,7 @@
90
91
  },
91
92
  "dependencies": {
92
93
  "@simplewebauthn/browser": "^13.1.0",
94
+ "eslint-plugin-license-header": "^0.9.0",
93
95
  "libphonenumber-js": "^1.12.7",
94
96
  "ts-node": "^10.9.2"
95
97
  },
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const LoadingSpinner: React.FC;
3
- export default LoadingSpinner;
package/dist/Login.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Login: React.FC;
3
- export default Login;
@@ -1,2 +0,0 @@
1
- declare function MagicLogin(): import("react/jsx-runtime").JSX.Element;
2
- export default MagicLogin;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const MfaLogin: React.FC;
3
- export default MfaLogin;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const PassKeyLogin: React.FC;
3
- export default PassKeyLogin;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const RegisterPasskey: React.FC;
3
- export default RegisterPasskey;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface TermsModalProps {
3
- isOpen: boolean;
4
- onClose: () => void;
5
- }
6
- declare const TermsModal: React.FC<TermsModalProps>;
7
- export default TermsModal;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const VerifyEmailOTP: React.FC;
3
- export default VerifyEmailOTP;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const VerifyMagicLink: React.FC;
3
- export default VerifyMagicLink;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const VerifyOTP: React.FC;
3
- export default VerifyOTP;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const VerifyPhoneOTP: React.FC;
3
- export default VerifyPhoneOTP;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const LoadingSpinner: React.FC;
3
- export default LoadingSpinner;
@@ -1,3 +0,0 @@
1
- export declare function useVerifyMagicLink(): {
2
- verified: boolean;
3
- };