@bagelink/auth 1.12.3 → 1.12.5

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.
Files changed (37) hide show
  1. package/dist/index.cjs +2 -1183
  2. package/dist/index.d.ts +0 -9
  3. package/dist/index.mjs +3 -1184
  4. package/dist/routes.d.ts +0 -36
  5. package/package.json +1 -1
  6. package/src/index.ts +0 -13
  7. package/src/routes.ts +0 -96
  8. package/dist/Callback-BHqVaZZm.cjs +0 -4
  9. package/dist/Callback-C-XghN_z.js +0 -4
  10. package/dist/ForgotPasswordPage-BV9tyhHl.cjs +0 -4
  11. package/dist/ForgotPasswordPage-DvttMGb0.js +0 -4
  12. package/dist/LoginPage-hv1wc54S.cjs +0 -4
  13. package/dist/LoginPage-klj1NV4J.js +0 -4
  14. package/dist/ResetPasswordPage-COPrJmW8.cjs +0 -4
  15. package/dist/ResetPasswordPage-nvQ4uupb.js +0 -4
  16. package/dist/SignupPage-m36w9PLJ.cjs +0 -4
  17. package/dist/SignupPage-oUFYApYW.js +0 -4
  18. package/dist/components/auth/ForgotPasswordForm.vue.d.ts +0 -23
  19. package/dist/components/auth/LoginForm.vue.d.ts +0 -58
  20. package/dist/components/auth/ResetPasswordForm.vue.d.ts +0 -28
  21. package/dist/components/auth/SignupForm.vue.d.ts +0 -34
  22. package/dist/components/index.d.ts +0 -4
  23. package/dist/pages/Callback.vue.d.ts +0 -2
  24. package/dist/pages/ForgotPasswordPage.vue.d.ts +0 -13
  25. package/dist/pages/LoginPage.vue.d.ts +0 -38
  26. package/dist/pages/ResetPasswordPage.vue.d.ts +0 -13
  27. package/dist/pages/SignupPage.vue.d.ts +0 -16
  28. package/src/components/auth/ForgotPasswordForm.vue +0 -97
  29. package/src/components/auth/LoginForm.vue +0 -258
  30. package/src/components/auth/ResetPasswordForm.vue +0 -156
  31. package/src/components/auth/SignupForm.vue +0 -231
  32. package/src/components/index.ts +0 -5
  33. package/src/pages/Callback.vue +0 -196
  34. package/src/pages/ForgotPasswordPage.vue +0 -42
  35. package/src/pages/LoginPage.vue +0 -68
  36. package/src/pages/ResetPasswordPage.vue +0 -47
  37. package/src/pages/SignupPage.vue +0 -46
package/dist/index.cjs CHANGED
@@ -5,8 +5,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
6
  const axios = require("axios");
7
7
  const vue = require("vue");
8
- const vue$1 = require("@bagelink/vue");
9
- const vueRouter = require("vue-router");
10
8
  function createAxiosInstance(baseURL) {
11
9
  return axios.create({
12
10
  baseURL,
@@ -302,742 +300,6 @@ class AuthApi {
302
300
  return this.api.get("tenants");
303
301
  }
304
302
  }
305
- const _hoisted_1$8 = { class: "txt20 bold mb-1" };
306
- const _hoisted_2$4 = { class: "txt-center opacity-7" };
307
- const _hoisted_3$4 = { class: "txt20 bold txt-center mb-1" };
308
- const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
309
- __name: "ForgotPasswordForm",
310
- props: {
311
- emailSent: { type: Boolean, default: false },
312
- useHebrewDefaults: { type: Boolean, default: false },
313
- texts: { default: () => ({}) }
314
- },
315
- emits: ["switchForm"],
316
- setup(__props) {
317
- const props = __props;
318
- const { forgotPassword } = useAuth();
319
- const email = vue.ref("");
320
- const internalEmailSent = vue.ref(false);
321
- const showEmailSent = vue.computed(() => props.emailSent || internalEmailSent.value);
322
- const texts = vue.computed(() => {
323
- var _a, _b, _c, _d, _e, _f;
324
- const hebrewDefaults = {
325
- title: "שכחתם סיסמה",
326
- emailLabel: "איימיל",
327
- submitButton: "שליחת איימיל איפוס",
328
- backToLogin: "חזרה להתחברות",
329
- emailSentTitle: "איימיל נשלח!",
330
- emailSentMessage: "יש לבדוק את תיבת הדואר שלכם לקישור איפוס הסיסמה"
331
- };
332
- const englishDefaults = {
333
- title: "Forgot Password",
334
- emailLabel: "Email",
335
- submitButton: "Send Reset Email",
336
- backToLogin: "Back to Login",
337
- emailSentTitle: "Email Sent!",
338
- emailSentMessage: "Check your inbox for a password reset link"
339
- };
340
- const defaults = props.useHebrewDefaults ? hebrewDefaults : englishDefaults;
341
- return {
342
- title: ((_a = props.texts) == null ? void 0 : _a.title) ?? defaults.title,
343
- emailLabel: ((_b = props.texts) == null ? void 0 : _b.emailLabel) ?? defaults.emailLabel,
344
- submitButton: ((_c = props.texts) == null ? void 0 : _c.submitButton) ?? defaults.submitButton,
345
- backToLogin: ((_d = props.texts) == null ? void 0 : _d.backToLogin) ?? defaults.backToLogin,
346
- emailSentTitle: ((_e = props.texts) == null ? void 0 : _e.emailSentTitle) ?? defaults.emailSentTitle,
347
- emailSentMessage: ((_f = props.texts) == null ? void 0 : _f.emailSentMessage) ?? defaults.emailSentMessage
348
- };
349
- });
350
- const textDirection = vue.computed(() => ({ "auth-rtl": props.useHebrewDefaults }));
351
- async function handleRecoverPassword() {
352
- await forgotPassword(email.value);
353
- internalEmailSent.value = true;
354
- }
355
- return (_ctx, _cache) => {
356
- return showEmailSent.value ? (vue.openBlock(), vue.createElementBlock("div", {
357
- key: 0,
358
- class: vue.normalizeClass(["txt-center", [textDirection.value]])
359
- }, [
360
- vue.createVNode(vue.unref(vue$1.Icon), {
361
- name: "email",
362
- size: "4",
363
- class: "opacity-3 mb-1"
364
- }),
365
- vue.createElementVNode("h1", _hoisted_1$8, vue.toDisplayString(texts.value.emailSentTitle), 1),
366
- vue.createElementVNode("p", _hoisted_2$4, vue.toDisplayString(texts.value.emailSentMessage), 1),
367
- vue.createVNode(vue.unref(vue$1.Btn), {
368
- thin: "",
369
- flat: "",
370
- class: "txt-12 mt-2 underline",
371
- value: texts.value.backToLogin,
372
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("switchForm", "login"))
373
- }, null, 8, ["value"])
374
- ], 2)) : (vue.openBlock(), vue.createElementBlock("form", {
375
- key: 1,
376
- class: vue.normalizeClass(textDirection.value),
377
- onSubmit: vue.withModifiers(handleRecoverPassword, ["prevent"])
378
- }, [
379
- vue.createElementVNode("h1", _hoisted_3$4, vue.toDisplayString(texts.value.title), 1),
380
- vue.createVNode(vue.unref(vue$1.TextInput), {
381
- modelValue: email.value,
382
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => email.value = $event),
383
- label: texts.value.emailLabel,
384
- autocomplete: "email",
385
- type: "email"
386
- }, null, 8, ["modelValue", "label"]),
387
- vue.createVNode(vue.unref(vue$1.Btn), {
388
- type: "submit",
389
- class: "w-100 mt-05",
390
- value: texts.value.submitButton
391
- }, null, 8, ["value"]),
392
- vue.createVNode(vue.unref(vue$1.Btn), {
393
- thin: "",
394
- flat: "",
395
- class: "txt-12 mt-075 underline block",
396
- value: texts.value.backToLogin,
397
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("switchForm", "login"))
398
- }, null, 8, ["value"])
399
- ], 34));
400
- };
401
- }
402
- });
403
- const _hoisted_1$7 = { class: "txt20 bold txt-center mb-1" };
404
- const _hoisted_2$3 = { key: 1 };
405
- const _hoisted_3$3 = {
406
- key: 0,
407
- class: "flex gap-1 opacity-6"
408
- };
409
- const _hoisted_4$2 = { class: "txt-center my-05" };
410
- const _hoisted_5$2 = { class: "h-20px pt-075" };
411
- const _hoisted_6$2 = {
412
- key: 0,
413
- class: "txt-center color-red txt-12"
414
- };
415
- const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
416
- __name: "LoginForm",
417
- props: {
418
- hideRegularLogin: { type: Boolean, default: false },
419
- showForgotPassword: { type: Boolean, default: true },
420
- showSignupButton: { type: Boolean, default: true },
421
- github: { type: Boolean, default: false },
422
- google: { type: Boolean, default: false },
423
- microsoft: { type: Boolean, default: false },
424
- apple: { type: Boolean, default: false },
425
- okta: { type: Boolean, default: false },
426
- facebook: { type: Boolean, default: false },
427
- ssoOutline: { type: Boolean, default: true },
428
- ssoShowValue: { type: Boolean, default: true },
429
- ssoSize: { default: void 0 },
430
- ssoAlign: { type: Boolean, default: false },
431
- ssoBrandBackground: { type: Boolean, default: true },
432
- useHebrewDefaults: { type: Boolean, default: false },
433
- errorState: { default: "normal" },
434
- texts: { default: () => ({}) }
435
- },
436
- emits: ["switchForm"],
437
- setup(__props) {
438
- const props = __props;
439
- const { login, sso: sso2 } = useAuth();
440
- const form = vue.ref({
441
- email: "",
442
- password: ""
443
- });
444
- const internalError = vue.ref("");
445
- const texts = vue.computed(() => {
446
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
447
- const hebrewDefaults = {
448
- title: "התחברות",
449
- emailLabel: "אימייל",
450
- passwordLabel: "סיסמה",
451
- forgotPassword: "שכחתם סיסמה?",
452
- loginButton: "התחברות",
453
- signupButton: "יצירת חשבון",
454
- orText: "או",
455
- githubButton: "התחברות עם GitHub",
456
- googleButton: "התחברות עם Google",
457
- microsoftButton: "התחברות עם Microsoft",
458
- appleButton: "התחברות עם Apple",
459
- oktaButton: "התחברות עם Okta",
460
- facebookButton: "התחברות עם Facebook"
461
- };
462
- const englishDefaults = {
463
- title: "Login",
464
- emailLabel: "Email",
465
- passwordLabel: "Password",
466
- forgotPassword: "Forgot Password",
467
- loginButton: "Login",
468
- signupButton: "Create Account",
469
- orText: "or",
470
- githubButton: "Continue with GitHub",
471
- googleButton: "Continue with Google",
472
- microsoftButton: "Continue with Microsoft",
473
- appleButton: "Continue with Apple",
474
- oktaButton: "Continue with Okta",
475
- facebookButton: "Continue with Facebook"
476
- };
477
- const defaults = props.useHebrewDefaults ? hebrewDefaults : englishDefaults;
478
- return {
479
- title: ((_a = props.texts) == null ? void 0 : _a.title) ?? defaults.title,
480
- emailLabel: ((_b = props.texts) == null ? void 0 : _b.emailLabel) ?? defaults.emailLabel,
481
- passwordLabel: ((_c = props.texts) == null ? void 0 : _c.passwordLabel) ?? defaults.passwordLabel,
482
- forgotPassword: ((_d = props.texts) == null ? void 0 : _d.forgotPassword) ?? defaults.forgotPassword,
483
- loginButton: ((_e = props.texts) == null ? void 0 : _e.loginButton) ?? defaults.loginButton,
484
- signupButton: ((_f = props.texts) == null ? void 0 : _f.signupButton) ?? defaults.signupButton,
485
- orText: ((_g = props.texts) == null ? void 0 : _g.orText) ?? defaults.orText,
486
- githubButton: ((_h = props.texts) == null ? void 0 : _h.githubButton) ?? defaults.githubButton,
487
- googleButton: ((_i = props.texts) == null ? void 0 : _i.googleButton) ?? defaults.googleButton,
488
- microsoftButton: ((_j = props.texts) == null ? void 0 : _j.microsoftButton) ?? defaults.microsoftButton,
489
- appleButton: ((_k = props.texts) == null ? void 0 : _k.appleButton) ?? defaults.appleButton,
490
- oktaButton: ((_l = props.texts) == null ? void 0 : _l.oktaButton) ?? defaults.oktaButton,
491
- facebookButton: ((_m = props.texts) == null ? void 0 : _m.facebookButton) ?? defaults.facebookButton
492
- };
493
- });
494
- const showAnySso = vue.computed(
495
- () => props.github || props.google || props.microsoft || props.apple || props.okta || props.facebook
496
- );
497
- const textDirection = vue.computed(() => ({ "auth-rtl": props.useHebrewDefaults }));
498
- const error = vue.computed(() => getDevError() || internalError.value);
499
- function getDevError() {
500
- switch (props.errorState) {
501
- case "email-required":
502
- return props.useHebrewDefaults ? "איימיל נדרש" : "Email is required";
503
- case "email-invalid":
504
- return props.useHebrewDefaults ? "יש להזין כתובת איימיל תקינה" : "Please enter a valid email address";
505
- case "password-required":
506
- return props.useHebrewDefaults ? "סיסמה נדרשת" : "Password is required";
507
- case "invalid-credentials":
508
- return props.useHebrewDefaults ? "איימיל או סיסמה לא נכונים" : "Invalid email or password";
509
- case "server-error":
510
- return props.useHebrewDefaults ? "ההתחברות נכשלה. אנא נסה שוב." : "Login failed. Please try again.";
511
- default:
512
- return null;
513
- }
514
- }
515
- async function handleLogin() {
516
- internalError.value = "";
517
- if (props.errorState !== "normal") {
518
- return;
519
- }
520
- const { message } = await login(form.value);
521
- internalError.value = message;
522
- }
523
- return (_ctx, _cache) => {
524
- const _directive_tooltip = vue.resolveDirective("tooltip");
525
- return vue.openBlock(), vue.createElementBlock("form", {
526
- class: vue.normalizeClass(textDirection.value),
527
- onSubmit: vue.withModifiers(handleLogin, ["prevent"])
528
- }, [
529
- vue.createElementVNode("h1", _hoisted_1$7, vue.toDisplayString(texts.value.title), 1),
530
- !props.hideRegularLogin ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
531
- vue.createVNode(vue.unref(vue$1.TextInput), {
532
- modelValue: form.value.email,
533
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value.email = $event),
534
- type: "email",
535
- label: texts.value.emailLabel,
536
- autocomplete: "email"
537
- }, null, 8, ["modelValue", "label"]),
538
- vue.createVNode(vue.unref(vue$1.PasswordInput), {
539
- modelValue: form.value.password,
540
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.value.password = $event),
541
- label: texts.value.passwordLabel
542
- }, null, 8, ["modelValue", "label"]),
543
- props.showForgotPassword ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
544
- key: 0,
545
- thin: "",
546
- flat: "",
547
- class: "txt-12 mt-075 underline block",
548
- value: texts.value.forgotPassword,
549
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("switchForm", "forgot-password"))
550
- }, null, 8, ["value"])) : vue.createCommentVNode("", true),
551
- vue.createVNode(vue.unref(vue$1.Btn), {
552
- type: "submit",
553
- class: "w-100 mt-1",
554
- value: texts.value.loginButton
555
- }, null, 8, ["value"]),
556
- props.showSignupButton ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
557
- key: 1,
558
- outline: "",
559
- color: "primary",
560
- class: "w-100 mt-05",
561
- value: texts.value.signupButton,
562
- onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("switchForm", "signup"))
563
- }, null, 8, ["value"])) : vue.createCommentVNode("", true)
564
- ], 64)) : vue.createCommentVNode("", true),
565
- showAnySso.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
566
- !props.hideRegularLogin ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
567
- _cache[10] || (_cache[10] = vue.createElementVNode("div", { class: "line" }, null, -1)),
568
- vue.createElementVNode("p", _hoisted_4$2, vue.toDisplayString(texts.value.orText), 1),
569
- _cache[11] || (_cache[11] = vue.createElementVNode("div", { class: "line" }, null, -1))
570
- ])) : vue.createCommentVNode("", true),
571
- vue.createElementVNode("div", {
572
- class: vue.normalizeClass(["gap-05", { "grid grid-wrap-1": props.ssoShowValue, "flex justify-content-center gap-05 flex-wrap": !props.ssoShowValue }])
573
- }, [
574
- props.github ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
575
- key: 0,
576
- outline: props.ssoOutline,
577
- "full-width": props.ssoAlign,
578
- "align-txt": props.ssoAlign ? "start" : void 0,
579
- style: vue.normalizeStyle(props.ssoOutline ? "color: #24292F;" : `color: #FFFFFF; ${props.ssoBrandBackground ? "background: #24292F;" : ""}`),
580
- icon: "github",
581
- class: vue.normalizeClass({ "px-075": props.ssoAlign ? "px-075" : "" }),
582
- value: props.ssoShowValue ? texts.value.githubButton : void 0,
583
- size: props.ssoSize,
584
- onClick: _cache[4] || (_cache[4] = ($event) => vue.unref(sso2).github.redirect())
585
- }, null, 8, ["outline", "full-width", "align-txt", "style", "class", "value", "size"])), [
586
- [_directive_tooltip, !props.ssoShowValue ? texts.value.githubButton : void 0]
587
- ]) : vue.createCommentVNode("", true),
588
- props.google ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
589
- key: 1,
590
- outline: props.ssoOutline,
591
- "full-width": props.ssoAlign,
592
- "align-txt": props.ssoAlign ? "start" : void 0,
593
- style: vue.normalizeStyle(props.ssoOutline ? "color: #DB4437;" : `color: #FFFFFF; ${props.ssoBrandBackground ? "background: #DB4437;" : ""}`),
594
- icon: "google",
595
- class: vue.normalizeClass({ "px-075": props.ssoAlign ? "px-075" : "" }),
596
- value: props.ssoShowValue ? texts.value.googleButton : void 0,
597
- size: props.ssoSize,
598
- onClick: _cache[5] || (_cache[5] = ($event) => vue.unref(sso2).google.redirect())
599
- }, null, 8, ["outline", "full-width", "align-txt", "style", "class", "value", "size"])), [
600
- [_directive_tooltip, !props.ssoShowValue ? texts.value.googleButton : void 0]
601
- ]) : vue.createCommentVNode("", true),
602
- props.microsoft ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
603
- key: 2,
604
- outline: props.ssoOutline,
605
- "full-width": props.ssoAlign,
606
- "align-txt": props.ssoAlign ? "start" : void 0,
607
- style: vue.normalizeStyle(props.ssoOutline ? "color: #2F2FEE;" : `color: #FFFFFF; ${props.ssoBrandBackground ? "background: #2F2FEE;" : ""}`),
608
- icon: "microsoft",
609
- class: vue.normalizeClass({ "px-075": props.ssoAlign ? "px-075" : "" }),
610
- value: props.ssoShowValue ? texts.value.microsoftButton : void 0,
611
- size: props.ssoSize,
612
- onClick: _cache[6] || (_cache[6] = ($event) => vue.unref(sso2).microsoft.redirect())
613
- }, null, 8, ["outline", "full-width", "align-txt", "style", "class", "value", "size"])), [
614
- [_directive_tooltip, !props.ssoShowValue ? texts.value.microsoftButton : void 0]
615
- ]) : vue.createCommentVNode("", true),
616
- props.apple ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
617
- key: 3,
618
- outline: props.ssoOutline,
619
- "full-width": props.ssoAlign,
620
- "align-txt": props.ssoAlign ? "start" : void 0,
621
- style: vue.normalizeStyle(props.ssoOutline ? "color: #000000;" : `color: #FFFFFF; ${props.ssoBrandBackground ? "background: #000000;" : ""}`),
622
- icon: "apple",
623
- class: vue.normalizeClass({ "px-075": props.ssoAlign ? "px-075" : "" }),
624
- value: props.ssoShowValue ? texts.value.appleButton : void 0,
625
- size: props.ssoSize,
626
- onClick: _cache[7] || (_cache[7] = ($event) => vue.unref(sso2).apple.redirect())
627
- }, null, 8, ["outline", "full-width", "align-txt", "style", "class", "value", "size"])), [
628
- [_directive_tooltip, !props.ssoShowValue ? texts.value.appleButton : void 0]
629
- ]) : vue.createCommentVNode("", true),
630
- props.okta ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
631
- key: 4,
632
- outline: props.ssoOutline,
633
- "full-width": props.ssoAlign,
634
- "align-txt": props.ssoAlign ? "start" : void 0,
635
- style: vue.normalizeStyle(props.ssoOutline ? "color: #FFB600;" : `color: #FFFFFF; ${props.ssoBrandBackground ? "background: #FFB600;" : ""}`),
636
- icon: "sun",
637
- class: vue.normalizeClass({ "px-075": props.ssoAlign ? "px-075" : "" }),
638
- value: props.ssoShowValue ? texts.value.oktaButton : void 0,
639
- size: props.ssoSize,
640
- onClick: _cache[8] || (_cache[8] = ($event) => vue.unref(sso2).okta.redirect())
641
- }, null, 8, ["outline", "full-width", "align-txt", "style", "class", "value", "size"])), [
642
- [_directive_tooltip, !props.ssoShowValue ? texts.value.oktaButton : void 0]
643
- ]) : vue.createCommentVNode("", true),
644
- props.facebook ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(vue$1.Btn), {
645
- key: 5,
646
- outline: props.ssoOutline,
647
- "full-width": props.ssoAlign,
648
- "align-txt": props.ssoAlign ? "start" : void 0,
649
- style: vue.normalizeStyle(props.ssoOutline ? "color: #1877F3;" : `color: #FFFFFF; ${props.ssoBrandBackground ? "background: #1877F3;" : ""}`),
650
- icon: "facebook",
651
- class: vue.normalizeClass({ "px-075": props.ssoAlign ? "px-075" : "" }),
652
- value: props.ssoShowValue ? texts.value.facebookButton : void 0,
653
- size: props.ssoSize,
654
- onClick: _cache[9] || (_cache[9] = ($event) => vue.unref(sso2).facebook.redirect())
655
- }, null, 8, ["outline", "full-width", "align-txt", "style", "class", "value", "size"])), [
656
- [_directive_tooltip, !props.ssoShowValue ? texts.value.facebookButton : void 0]
657
- ]) : vue.createCommentVNode("", true)
658
- ], 2),
659
- vue.createElementVNode("div", _hoisted_5$2, [
660
- error.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$2, vue.toDisplayString(error.value), 1)) : vue.createCommentVNode("", true)
661
- ])
662
- ])) : vue.createCommentVNode("", true)
663
- ], 34);
664
- };
665
- }
666
- });
667
- const _hoisted_1$6 = { class: "txt20 bold mb-1" };
668
- const _hoisted_2$2 = { class: "opacity-7 mb-2" };
669
- const _hoisted_3$2 = { class: "txt20 bold mb-1" };
670
- const _hoisted_4$1 = { class: "opacity-7 mb-2" };
671
- const _hoisted_5$1 = { class: "txt20 bold txt-center mb-1" };
672
- const _hoisted_6$1 = { class: "h-20px pt-075" };
673
- const _hoisted_7$1 = {
674
- key: 0,
675
- class: "txt-center color-red txt-12"
676
- };
677
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
678
- __name: "ResetPasswordForm",
679
- props: {
680
- token: {},
681
- showSuccess: { type: Boolean },
682
- useHebrewDefaults: { type: Boolean, default: false },
683
- texts: {}
684
- },
685
- emits: ["switchForm"],
686
- setup(__props) {
687
- const props = __props;
688
- const { resetPassword } = useAuth();
689
- const error = vue.ref("");
690
- const internalSuccess = vue.ref(false);
691
- const newPassword = vue.ref("");
692
- const confirmPassword = vue.ref("");
693
- const isValidToken = vue.computed(() => !!props.token);
694
- const isSuccess = vue.computed(() => props.showSuccess || internalSuccess.value);
695
- const texts = vue.computed(() => {
696
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
697
- const hebrewDefaults = {
698
- title: "איפוס סיסמה",
699
- invalidLinkTitle: "קישור לא תקין",
700
- invalidLinkMessage: "קישור איפוס הסיסמה לא תקין או פג תוקף",
701
- newPasswordLabel: "סיסמה חדשה",
702
- confirmPasswordLabel: "אימות סיסמה",
703
- submitButton: "איפוס סיסמה",
704
- backToLogin: "חזרה להתחברות",
705
- passwordMismatchError: "הסיסמאות לא תואמות",
706
- invalidTokenError: "אסימון לא תקין",
707
- successTitle: "הסיסמה אופסה בהצלחה!",
708
- successMessage: "הסיסמה שלכם אופסה. כעת תוכלו להתחברות עם הסיסמה החדשה.",
709
- goToLogin: "מעבר להתחברות"
710
- };
711
- const englishDefaults = {
712
- title: "Reset Password",
713
- invalidLinkTitle: "Invalid Link",
714
- invalidLinkMessage: "This reset link is invalid or has expired",
715
- newPasswordLabel: "New Password",
716
- confirmPasswordLabel: "Confirm Password",
717
- submitButton: "Reset Password",
718
- backToLogin: "Back to Login",
719
- passwordMismatchError: "Passwords do not match",
720
- invalidTokenError: "Invalid token",
721
- successTitle: "Password Reset Successfully!",
722
- successMessage: "Your password has been reset. You can now log in with your new password.",
723
- goToLogin: "Go to Login"
724
- };
725
- const defaults = props.useHebrewDefaults ? hebrewDefaults : englishDefaults;
726
- return {
727
- title: ((_a = props.texts) == null ? void 0 : _a.title) ?? defaults.title,
728
- invalidLinkTitle: ((_b = props.texts) == null ? void 0 : _b.invalidLinkTitle) ?? defaults.invalidLinkTitle,
729
- invalidLinkMessage: ((_c = props.texts) == null ? void 0 : _c.invalidLinkMessage) ?? defaults.invalidLinkMessage,
730
- newPasswordLabel: ((_d = props.texts) == null ? void 0 : _d.newPasswordLabel) ?? defaults.newPasswordLabel,
731
- confirmPasswordLabel: ((_e = props.texts) == null ? void 0 : _e.confirmPasswordLabel) ?? defaults.confirmPasswordLabel,
732
- submitButton: ((_f = props.texts) == null ? void 0 : _f.submitButton) ?? defaults.submitButton,
733
- backToLogin: ((_g = props.texts) == null ? void 0 : _g.backToLogin) ?? defaults.backToLogin,
734
- passwordMismatchError: ((_h = props.texts) == null ? void 0 : _h.passwordMismatchError) ?? defaults.passwordMismatchError,
735
- invalidTokenError: ((_i = props.texts) == null ? void 0 : _i.invalidTokenError) ?? defaults.invalidTokenError,
736
- successTitle: ((_j = props.texts) == null ? void 0 : _j.successTitle) ?? defaults.successTitle,
737
- successMessage: ((_k = props.texts) == null ? void 0 : _k.successMessage) ?? defaults.successMessage,
738
- goToLogin: ((_l = props.texts) == null ? void 0 : _l.goToLogin) ?? defaults.goToLogin
739
- };
740
- });
741
- const textDirection = vue.computed(() => ({ "auth-rtl": props.useHebrewDefaults }));
742
- async function handleResetPassword() {
743
- if (newPassword.value !== confirmPassword.value) {
744
- error.value = texts.value.passwordMismatchError;
745
- return;
746
- }
747
- if (!props.token) {
748
- error.value = texts.value.invalidTokenError;
749
- return;
750
- }
751
- try {
752
- await resetPassword(props.token, newPassword.value);
753
- internalSuccess.value = true;
754
- error.value = "";
755
- } catch (err) {
756
- error.value = err instanceof Error ? err.message : "Reset failed";
757
- }
758
- }
759
- return (_ctx, _cache) => {
760
- return !isValidToken.value ? (vue.openBlock(), vue.createElementBlock("div", {
761
- key: 0,
762
- class: vue.normalizeClass(["txt-center", textDirection.value])
763
- }, [
764
- vue.createElementVNode("h1", _hoisted_1$6, vue.toDisplayString(texts.value.invalidLinkTitle), 1),
765
- vue.createElementVNode("p", _hoisted_2$2, vue.toDisplayString(texts.value.invalidLinkMessage), 1),
766
- vue.createVNode(vue.unref(vue$1.Btn), {
767
- value: texts.value.backToLogin,
768
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("switchForm", "login"))
769
- }, null, 8, ["value"])
770
- ], 2)) : isSuccess.value ? (vue.openBlock(), vue.createElementBlock("div", {
771
- key: 1,
772
- class: vue.normalizeClass(["txt-center", textDirection.value])
773
- }, [
774
- vue.createVNode(vue.unref(vue$1.Icon), {
775
- name: "check_circle",
776
- size: "4",
777
- class: "txt-green mb-1"
778
- }),
779
- vue.createElementVNode("h1", _hoisted_3$2, vue.toDisplayString(texts.value.successTitle), 1),
780
- vue.createElementVNode("p", _hoisted_4$1, vue.toDisplayString(texts.value.successMessage), 1),
781
- vue.createVNode(vue.unref(vue$1.Btn), {
782
- value: texts.value.goToLogin,
783
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("switchForm", "login"))
784
- }, null, 8, ["value"])
785
- ], 2)) : (vue.openBlock(), vue.createElementBlock("form", {
786
- key: 2,
787
- class: vue.normalizeClass(textDirection.value),
788
- onSubmit: vue.withModifiers(handleResetPassword, ["prevent"])
789
- }, [
790
- vue.createElementVNode("h1", _hoisted_5$1, vue.toDisplayString(texts.value.title), 1),
791
- vue.createVNode(vue.unref(vue$1.PasswordInput), {
792
- modelValue: newPassword.value,
793
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => newPassword.value = $event),
794
- class: "mb-05",
795
- label: texts.value.newPasswordLabel,
796
- autocomplete: "new-password"
797
- }, null, 8, ["modelValue", "label"]),
798
- vue.createVNode(vue.unref(vue$1.PasswordInput), {
799
- modelValue: confirmPassword.value,
800
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => confirmPassword.value = $event),
801
- label: texts.value.confirmPasswordLabel,
802
- autocomplete: "new-password"
803
- }, null, 8, ["modelValue", "label"]),
804
- vue.createVNode(vue.unref(vue$1.Btn), {
805
- type: "submit",
806
- class: "w-100 mt-2",
807
- value: texts.value.submitButton
808
- }, null, 8, ["value"]),
809
- vue.createVNode(vue.unref(vue$1.Btn), {
810
- thin: "",
811
- flat: "",
812
- class: "txt-12 mt-075 underline block",
813
- value: texts.value.backToLogin,
814
- onClick: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("switchForm", "login"))
815
- }, null, 8, ["value"]),
816
- vue.createElementVNode("div", _hoisted_6$1, [
817
- error.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_7$1, vue.toDisplayString(error.value), 1)) : vue.createCommentVNode("", true)
818
- ])
819
- ], 34));
820
- };
821
- }
822
- });
823
- const _hoisted_1$5 = { class: "txt20 bold txt-center mb-1" };
824
- const _hoisted_2$1 = { class: "h-20px pt-075" };
825
- const _hoisted_3$1 = {
826
- key: 0,
827
- class: "txt-center color-red txt-12"
828
- };
829
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
830
- __name: "SignupForm",
831
- props: {
832
- showNames: { type: Boolean, default: true },
833
- useHebrewDefaults: { type: Boolean, default: false },
834
- errorState: { default: "normal" },
835
- texts: { default: () => ({}) }
836
- },
837
- emits: ["switchForm"],
838
- setup(__props) {
839
- const props = __props;
840
- const { signup, login } = useAuth();
841
- const internalError = vue.ref("");
842
- const error = vue.computed(() => {
843
- if (props.errorState !== "normal") {
844
- return getDevError();
845
- }
846
- return internalError.value;
847
- });
848
- const form = vue.ref({
849
- email: "",
850
- password: "",
851
- confirmPassword: "",
852
- first_name: "",
853
- last_name: ""
854
- });
855
- const texts = vue.computed(() => {
856
- const hebrewDefaults = {
857
- title: "יצירת חשבון",
858
- firstNameLabel: "שם פרטי",
859
- lastNameLabel: "שם משפחה",
860
- emailLabel: "איימיל",
861
- passwordLabel: "סיסמה",
862
- confirmPasswordLabel: "אימות סיסמה",
863
- signupButton: "יצירת חשבון",
864
- alreadyHaveAccount: "יש לך כבר חשבון?",
865
- // Validation errors
866
- emailRequiredError: "איימיל נדרש",
867
- emailInvalidError: "יש להזין כתובת איימיל תקינה",
868
- passwordRequiredError: "סיסמה נדרשת",
869
- passwordTooShortError: "הסיסמה חייבת להיות לפחות 8 תווים",
870
- passwordMismatchError: "הסיסמאות לא תואמות",
871
- firstNameRequiredError: "שם פרטי נדרש",
872
- lastNameRequiredError: "שם משפחה נדרש"
873
- };
874
- const englishDefaults = {
875
- title: "Create Account",
876
- firstNameLabel: "First Name",
877
- lastNameLabel: "Last Name",
878
- emailLabel: "Email",
879
- passwordLabel: "Password",
880
- confirmPasswordLabel: "Confirm Password",
881
- signupButton: "Create Account",
882
- alreadyHaveAccount: "Already have an account?",
883
- // Validation errors
884
- emailRequiredError: "Email is required",
885
- emailInvalidError: "Please enter a valid email address",
886
- passwordRequiredError: "Password is required",
887
- passwordTooShortError: "Password must be at least 8 characters",
888
- passwordMismatchError: "Passwords do not match",
889
- firstNameRequiredError: "First name is required",
890
- lastNameRequiredError: "Last name is required"
891
- };
892
- const defaults = props.useHebrewDefaults ? hebrewDefaults : englishDefaults;
893
- return {
894
- title: props.texts.title || defaults.title,
895
- firstNameLabel: props.texts.firstNameLabel || defaults.firstNameLabel,
896
- lastNameLabel: props.texts.lastNameLabel || defaults.lastNameLabel,
897
- emailLabel: props.texts.emailLabel || defaults.emailLabel,
898
- passwordLabel: props.texts.passwordLabel || defaults.passwordLabel,
899
- confirmPasswordLabel: props.texts.confirmPasswordLabel || defaults.confirmPasswordLabel,
900
- signupButton: props.texts.signupButton || defaults.signupButton,
901
- alreadyHaveAccount: props.texts.alreadyHaveAccount || defaults.alreadyHaveAccount,
902
- // Validation errors
903
- emailRequiredError: props.texts.emailRequiredError || defaults.emailRequiredError,
904
- emailInvalidError: props.texts.emailInvalidError || defaults.emailInvalidError,
905
- passwordRequiredError: props.texts.passwordRequiredError || defaults.passwordRequiredError,
906
- passwordTooShortError: props.texts.passwordTooShortError || defaults.passwordTooShortError,
907
- passwordMismatchError: props.texts.passwordMismatchError || defaults.passwordMismatchError,
908
- firstNameRequiredError: props.texts.firstNameRequiredError || defaults.firstNameRequiredError,
909
- lastNameRequiredError: props.texts.lastNameRequiredError || defaults.lastNameRequiredError
910
- };
911
- });
912
- const textDirection = vue.computed(() => ({ "auth-rtl": props.useHebrewDefaults }));
913
- function getDevError() {
914
- switch (props.errorState) {
915
- case "email-required":
916
- return texts.value.emailRequiredError;
917
- case "email-invalid":
918
- return texts.value.emailInvalidError;
919
- case "password-short":
920
- return texts.value.passwordTooShortError;
921
- case "password-mismatch":
922
- return texts.value.passwordMismatchError;
923
- case "name-required":
924
- return props.showNames ? texts.value.firstNameRequiredError : null;
925
- case "server-error":
926
- return props.useHebrewDefaults ? "כתובת האימייל כבר קיימת או שגיאת שרת" : "Email already exists or server error";
927
- default:
928
- return null;
929
- }
930
- }
931
- function validateForm() {
932
- if (!form.value.email.trim()) {
933
- return texts.value.emailRequiredError;
934
- }
935
- const emailRegex = /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/;
936
- if (!emailRegex.test(form.value.email)) {
937
- return texts.value.emailInvalidError;
938
- }
939
- if (!form.value.password) {
940
- return texts.value.passwordRequiredError;
941
- }
942
- if (form.value.password.length < 8) {
943
- return texts.value.passwordTooShortError;
944
- }
945
- if (form.value.password !== form.value.confirmPassword) {
946
- return texts.value.passwordMismatchError;
947
- }
948
- if (props.showNames) {
949
- if (!form.value.first_name.trim()) {
950
- return texts.value.firstNameRequiredError;
951
- }
952
- if (!form.value.last_name.trim()) {
953
- return texts.value.lastNameRequiredError;
954
- }
955
- }
956
- return null;
957
- }
958
- async function handleSignup() {
959
- if (props.errorState !== "normal") {
960
- return;
961
- }
962
- internalError.value = "";
963
- const validationError = validateForm();
964
- if (validationError) {
965
- internalError.value = validationError;
966
- return;
967
- }
968
- const { message, success } = await signup(form.value).catch((error2) => {
969
- var _a, _b;
970
- console.error(error2);
971
- const errorMessage = (_b = (_a = error2.response) == null ? void 0 : _a.data) == null ? void 0 : _b.detail;
972
- if (errorMessage == null ? void 0 : errorMessage.toLowerCase().includes("email")) {
973
- return { success: false, message: "Email already exists or invalid" };
974
- }
975
- if (errorMessage == null ? void 0 : errorMessage.toLowerCase().includes("password")) {
976
- return { success: false, message: "Password does not meet requirements" };
977
- }
978
- return { success: false, message: errorMessage || "Registration failed. Please try again." };
979
- });
980
- if (!success) {
981
- internalError.value = message;
982
- return;
983
- }
984
- await login({ email: form.value.email, password: form.value.password });
985
- }
986
- return (_ctx, _cache) => {
987
- return vue.openBlock(), vue.createElementBlock("form", {
988
- class: vue.normalizeClass(textDirection.value),
989
- onSubmit: vue.withModifiers(handleSignup, ["prevent"])
990
- }, [
991
- vue.createElementVNode("h1", _hoisted_1$5, vue.toDisplayString(texts.value.title), 1),
992
- props.showNames ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.TextInput), {
993
- key: 0,
994
- modelValue: form.value.first_name,
995
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value.first_name = $event),
996
- label: texts.value.firstNameLabel
997
- }, null, 8, ["modelValue", "label"])) : vue.createCommentVNode("", true),
998
- props.showNames ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.TextInput), {
999
- key: 1,
1000
- modelValue: form.value.last_name,
1001
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.value.last_name = $event),
1002
- label: texts.value.lastNameLabel
1003
- }, null, 8, ["modelValue", "label"])) : vue.createCommentVNode("", true),
1004
- vue.createVNode(vue.unref(vue$1.TextInput), {
1005
- modelValue: form.value.email,
1006
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.value.email = $event),
1007
- type: "email",
1008
- label: texts.value.emailLabel,
1009
- autocomplete: "username"
1010
- }, null, 8, ["modelValue", "label"]),
1011
- vue.createVNode(vue.unref(vue$1.PasswordInput), {
1012
- modelValue: form.value.password,
1013
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.value.password = $event),
1014
- class: "mb-05",
1015
- label: texts.value.passwordLabel
1016
- }, null, 8, ["modelValue", "label"]),
1017
- vue.createVNode(vue.unref(vue$1.PasswordInput), {
1018
- modelValue: form.value.confirmPassword,
1019
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.value.confirmPassword = $event),
1020
- label: texts.value.confirmPasswordLabel
1021
- }, null, 8, ["modelValue", "label"]),
1022
- vue.createVNode(vue.unref(vue$1.Btn), {
1023
- class: "w-100 mt-2",
1024
- value: texts.value.signupButton,
1025
- type: "submit"
1026
- }, null, 8, ["value"]),
1027
- vue.createVNode(vue.unref(vue$1.Btn), {
1028
- thin: "",
1029
- flat: "",
1030
- class: "txt-12 mt-075 underline block",
1031
- value: texts.value.alreadyHaveAccount,
1032
- onClick: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("switchForm", "login"))
1033
- }, null, 8, ["value"]),
1034
- vue.createElementVNode("div", _hoisted_2$1, [
1035
- error.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3$1, vue.toDisplayString(error.value), 1)) : vue.createCommentVNode("", true)
1036
- ])
1037
- ], 34);
1038
- };
1039
- }
1040
- });
1041
303
  const INTAKE_WORKFLOW_ID = "fdba1933-0964-4850-b52a-7a4324175790";
1042
304
  const DEFAULT_AGENT_ID = "fdba1933-0964-4850-b52a-7a4324175790";
1043
305
  const providers = {
@@ -1048,387 +310,6 @@ const providers = {
1048
310
  okta: { name: "Okta", icon: "sun", color: "#FFB600" },
1049
311
  facebook: { name: "Facebook", icon: "facebook", color: "#1877F3" }
1050
312
  };
1051
- const _hoisted_1$4 = { class: "flex justify-content-center align-items-center vh-100 px-1" };
1052
- const _hoisted_2 = {
1053
- key: 0,
1054
- class: "flex column align-items-center gap-1"
1055
- };
1056
- const _hoisted_3 = { class: "mt-1" };
1057
- const _hoisted_4 = { class: "mb-05 pb-0 mt-0 txt24 m_txt20" };
1058
- const _hoisted_5 = { class: "opacity-7 txt-14" };
1059
- const _hoisted_6 = {
1060
- key: 1,
1061
- class: "flex column align-items-center gap-1"
1062
- };
1063
- const _hoisted_7 = { class: "flex justify-content-center align-items-center mb-1" };
1064
- const _hoisted_8 = { class: "relative" };
1065
- const _hoisted_9 = {
1066
- key: 0,
1067
- class: "absolute flex justify-content-center align-items-center bg-white rounded",
1068
- style: { "bottom": "-8px", "right": "-8px", "width": "40px", "height": "40px", "border": "3px solid white" }
1069
- };
1070
- const _hoisted_10 = { class: "mb-05 pb-0 mt-0 txt24 m_txt20" };
1071
- const _hoisted_11 = { class: "opacity-7 txt-14 mb-1" };
1072
- const _hoisted_12 = {
1073
- key: 0,
1074
- class: "bg-gray-light rounded p-1 mt-1"
1075
- };
1076
- const _hoisted_13 = { class: "flex column gap-05" };
1077
- const _hoisted_14 = {
1078
- key: 0,
1079
- class: "flex align-items-center gap-05 justify-content-center"
1080
- };
1081
- const _hoisted_15 = { class: "txt-14 bold" };
1082
- const _hoisted_16 = {
1083
- key: 1,
1084
- class: "flex align-items-center gap-05 justify-content-center"
1085
- };
1086
- const _hoisted_17 = { class: "txt-14 opacity-7" };
1087
- const _hoisted_18 = {
1088
- key: 2,
1089
- class: "flex gap-05 justify-content-center mt-05"
1090
- };
1091
- const _hoisted_19 = {
1092
- key: 2,
1093
- class: "flex column align-items-center gap-1"
1094
- };
1095
- const _hoisted_20 = { class: "opacity-7 txt-14 mb-1" };
1096
- const _hoisted_21 = { class: "flex gap-05 justify-content-center" };
1097
- const timeout = 4e3;
1098
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
1099
- __name: "Callback",
1100
- setup(__props) {
1101
- const isLoading = vue.ref(true);
1102
- const error = vue.ref(null);
1103
- const success = vue.ref(false);
1104
- const isLinking = vue.ref(false);
1105
- const provider = vue.ref(null);
1106
- const authResponse = vue.ref(null);
1107
- const { sso: sso2, user, accountInfo: accountInfo2 } = useAuth();
1108
- const route = vueRouter.useRoute();
1109
- const router2 = vueRouter.useRouter();
1110
- const providerInfo = vue.computed(() => {
1111
- if (provider.value === null) return null;
1112
- return providers[provider.value];
1113
- });
1114
- async function linkCallback() {
1115
- isLinking.value = true;
1116
- const { redirect: redirect2 } = route.query;
1117
- try {
1118
- await sso2.handleLinkCallback();
1119
- success.value = true;
1120
- setTimeout(() => {
1121
- const redirectPath = typeof redirect2 === "string" ? redirect2 : "/";
1122
- router2.push(redirectPath);
1123
- }, timeout);
1124
- } catch (err) {
1125
- const errorMessage = err instanceof Error ? err.message : "Failed to link account";
1126
- error.value = errorMessage;
1127
- } finally {
1128
- isLoading.value = false;
1129
- }
1130
- }
1131
- async function handleCallback() {
1132
- var _a;
1133
- const { state, redirect: redirect2 } = route.query;
1134
- provider.value = sessionStorage.getItem(`oauth_provider:${state}`);
1135
- console.log("[Callback] Query params:", { state, redirect: redirect2 });
1136
- console.log("[Callback] Full route query:", route.query);
1137
- try {
1138
- const response = await sso2.handleCallback();
1139
- if (response === null) {
1140
- error.value = `Failed to authenticate with ${((_a = providerInfo.value) == null ? void 0 : _a.name) ?? "provider"}`;
1141
- } else {
1142
- authResponse.value = response;
1143
- success.value = true;
1144
- console.log("[Callback] Login successful, redirect param:", redirect2);
1145
- setTimeout(() => {
1146
- const redirectPath = typeof redirect2 === "string" ? redirect2 : "/";
1147
- console.log("[Callback] Manual fallback redirecting to:", redirectPath);
1148
- router2.push(redirectPath);
1149
- }, timeout);
1150
- }
1151
- } catch (err) {
1152
- const errorMessage = err instanceof Error ? err.message : "Authentication failed";
1153
- error.value = errorMessage;
1154
- } finally {
1155
- isLoading.value = false;
1156
- }
1157
- }
1158
- vue.onMounted(async () => {
1159
- if (user.value) {
1160
- await linkCallback();
1161
- } else {
1162
- await handleCallback();
1163
- }
1164
- });
1165
- return (_ctx, _cache) => {
1166
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
1167
- vue.createVNode(vue.unref(vue$1.Card), { class: "p-2 txt-center w450px shadow" }, {
1168
- default: vue.withCtx(() => {
1169
- var _a, _b, _c, _d, _e, _f;
1170
- return [
1171
- isLoading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
1172
- vue.createVNode(vue.unref(vue$1.Loading)),
1173
- vue.createElementVNode("div", _hoisted_3, [
1174
- vue.createElementVNode("h2", _hoisted_4, vue.toDisplayString(isLinking.value ? "Linking Account" : "Authenticating"), 1),
1175
- vue.createElementVNode("p", _hoisted_5, " Please wait while we " + vue.toDisplayString(isLinking.value ? "link your" : "complete the") + " " + vue.toDisplayString(((_a = providerInfo.value) == null ? void 0 : _a.name) || "OAuth") + " " + vue.toDisplayString(isLinking.value ? "account" : "authentication") + ". ", 1)
1176
- ])
1177
- ])) : success.value && !error.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
1178
- vue.createElementVNode("div", _hoisted_7, [
1179
- vue.createElementVNode("div", _hoisted_8, [
1180
- vue.createVNode(vue.unref(vue$1.Icon), {
1181
- name: "check_circle",
1182
- size: "5",
1183
- class: "txt-green line-height-1"
1184
- }),
1185
- providerInfo.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
1186
- vue.createVNode(vue.unref(vue$1.Icon), {
1187
- name: providerInfo.value.icon,
1188
- size: "1.5",
1189
- style: vue.normalizeStyle({ color: providerInfo.value.color })
1190
- }, null, 8, ["name", "style"])
1191
- ])) : vue.createCommentVNode("", true)
1192
- ])
1193
- ]),
1194
- vue.createElementVNode("div", null, [
1195
- vue.createElementVNode("h2", _hoisted_10, vue.toDisplayString(isLinking.value ? "Account Linked!" : "Welcome Back!"), 1),
1196
- vue.createElementVNode("p", _hoisted_11, vue.toDisplayString(isLinking.value ? `Successfully linked your ${((_b = providerInfo.value) == null ? void 0 : _b.name) || "account"}.` : `You've successfully signed in with ${((_c = providerInfo.value) == null ? void 0 : _c.name) || "your account"}.`), 1),
1197
- vue.unref(user) || vue.unref(accountInfo2) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
1198
- vue.createElementVNode("div", _hoisted_13, [
1199
- ((_d = vue.unref(user)) == null ? void 0 : _d.name) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
1200
- vue.createVNode(vue.unref(vue$1.Icon), {
1201
- name: "person",
1202
- size: "1.2",
1203
- class: "opacity-7"
1204
- }),
1205
- vue.createElementVNode("span", _hoisted_15, vue.toDisplayString(vue.unref(user).name), 1)
1206
- ])) : vue.createCommentVNode("", true),
1207
- ((_e = vue.unref(user)) == null ? void 0 : _e.email) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
1208
- vue.createVNode(vue.unref(vue$1.Icon), {
1209
- name: "email",
1210
- size: "1.2",
1211
- class: "opacity-7"
1212
- }),
1213
- vue.createElementVNode("span", _hoisted_17, vue.toDisplayString(vue.unref(user).email), 1)
1214
- ])) : vue.createCommentVNode("", true),
1215
- ((_f = vue.unref(accountInfo2)) == null ? void 0 : _f.authentication_methods) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, [
1216
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(accountInfo2).authentication_methods, (method) => {
1217
- return vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), {
1218
- key: method.id,
1219
- name: method.type === "sso" ? method.provider || "link" : "password",
1220
- size: "1.2",
1221
- class: "opacity-5"
1222
- }, null, 8, ["name"]);
1223
- }), 128))
1224
- ])) : vue.createCommentVNode("", true)
1225
- ])
1226
- ])) : vue.createCommentVNode("", true),
1227
- _cache[0] || (_cache[0] = vue.createElementVNode("p", { class: "txt-12 opacity-5 mt-1" }, " Redirecting you to home... ", -1))
1228
- ])
1229
- ])) : error.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
1230
- vue.createVNode(vue.unref(vue$1.Icon), {
1231
- name: "error",
1232
- size: "5",
1233
- class: "txt-red mb-1 line-height-1"
1234
- }),
1235
- vue.createElementVNode("div", null, [
1236
- _cache[1] || (_cache[1] = vue.createElementVNode("h2", { class: "mb-05 pb-0 mt-0 txt24 m_txt20" }, " Authentication Failed ", -1)),
1237
- vue.createElementVNode("p", _hoisted_20, vue.toDisplayString(error.value), 1),
1238
- _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "bg-red-light rounded p-1 mt-1 mb-1" }, [
1239
- vue.createElementVNode("p", { class: "txt-12 opacity-7" }, " This could happen if: "),
1240
- vue.createElementVNode("ul", {
1241
- class: "txt-12 opacity-7 txt-start mt-05",
1242
- style: { "list-style": "none", "padding-left": "0" }
1243
- }, [
1244
- vue.createElementVNode("li", { class: "mb-025" }, " • The authorization was cancelled "),
1245
- vue.createElementVNode("li", { class: "mb-025" }, " • The state parameter was invalid "),
1246
- vue.createElementVNode("li", { class: "mb-025" }, " • The OAuth provider denied access "),
1247
- vue.createElementVNode("li", { class: "mb-025" }, " • Network connectivity issues ")
1248
- ])
1249
- ], -1)),
1250
- vue.createElementVNode("div", _hoisted_21, [
1251
- vue.createVNode(vue.unref(vue$1.Btn), {
1252
- outline: "",
1253
- value: "Try Again",
1254
- to: "/login"
1255
- }),
1256
- vue.createVNode(vue.unref(vue$1.Btn), {
1257
- value: "Go Home",
1258
- to: "/"
1259
- })
1260
- ])
1261
- ])
1262
- ])) : vue.createCommentVNode("", true)
1263
- ];
1264
- }),
1265
- _: 1
1266
- })
1267
- ]);
1268
- };
1269
- }
1270
- });
1271
- const _hoisted_1$3 = { class: "flex justify-content-center align-items-center min-vh-100 px-1 py-2" };
1272
- const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
1273
- __name: "ForgotPasswordPage",
1274
- props: {
1275
- texts: {},
1276
- cardWidth: { default: "450px" },
1277
- cardShadow: { type: Boolean, default: true }
1278
- },
1279
- setup(__props) {
1280
- const router2 = vueRouter.useRouter();
1281
- function switchForm(form) {
1282
- if (form === "login") {
1283
- router2.push("/login");
1284
- }
1285
- }
1286
- return (_ctx, _cache) => {
1287
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
1288
- vue.createVNode(vue.unref(vue$1.Card), {
1289
- class: vue.normalizeClass([{ shadow: _ctx.cardShadow }, "p-2"]),
1290
- style: vue.normalizeStyle({ width: _ctx.cardWidth, maxWidth: "100%" })
1291
- }, {
1292
- default: vue.withCtx(() => [
1293
- vue.createVNode(_sfc_main$8, {
1294
- texts: _ctx.texts,
1295
- onSwitchForm: switchForm
1296
- }, null, 8, ["texts"])
1297
- ]),
1298
- _: 1
1299
- }, 8, ["class", "style"])
1300
- ]);
1301
- };
1302
- }
1303
- });
1304
- const _hoisted_1$2 = { class: "flex justify-content-center align-items-center min-vh-100 px-1 py-2" };
1305
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1306
- __name: "LoginPage",
1307
- props: {
1308
- texts: {},
1309
- github: { type: Boolean, default: true },
1310
- google: { type: Boolean, default: true },
1311
- microsoft: { type: Boolean, default: true },
1312
- apple: { type: Boolean, default: true },
1313
- okta: { type: Boolean, default: true },
1314
- facebook: { type: Boolean, default: true },
1315
- ssoOutline: { type: Boolean, default: true },
1316
- ssoShowValue: { type: Boolean, default: true },
1317
- ssoBrandBackground: { type: Boolean, default: true },
1318
- showForgotPassword: { type: Boolean, default: true },
1319
- showSignupButton: { type: Boolean, default: true },
1320
- cardWidth: { default: "450px" },
1321
- cardShadow: { type: Boolean, default: true }
1322
- },
1323
- setup(__props) {
1324
- const router2 = vueRouter.useRouter();
1325
- function switchForm(form) {
1326
- if (form === "signup") {
1327
- router2.push("/signup");
1328
- } else if (form === "forgot-password") {
1329
- router2.push("/forgot-password");
1330
- }
1331
- }
1332
- return (_ctx, _cache) => {
1333
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
1334
- vue.createVNode(vue.unref(vue$1.Card), {
1335
- class: vue.normalizeClass([{ shadow: _ctx.cardShadow }, "p-2"]),
1336
- style: vue.normalizeStyle({ width: _ctx.cardWidth, maxWidth: "100%" })
1337
- }, {
1338
- default: vue.withCtx(() => [
1339
- vue.createVNode(_sfc_main$7, {
1340
- texts: _ctx.texts,
1341
- github: _ctx.github,
1342
- google: _ctx.google,
1343
- microsoft: _ctx.microsoft,
1344
- apple: _ctx.apple,
1345
- okta: _ctx.okta,
1346
- facebook: _ctx.facebook,
1347
- "sso-outline": _ctx.ssoOutline,
1348
- "sso-show-value": _ctx.ssoShowValue,
1349
- "sso-brand-background": _ctx.ssoBrandBackground,
1350
- "show-forgot-password": _ctx.showForgotPassword,
1351
- "show-signup-button": _ctx.showSignupButton,
1352
- onSwitchForm: switchForm
1353
- }, null, 8, ["texts", "github", "google", "microsoft", "apple", "okta", "facebook", "sso-outline", "sso-show-value", "sso-brand-background", "show-forgot-password", "show-signup-button"])
1354
- ]),
1355
- _: 1
1356
- }, 8, ["class", "style"])
1357
- ]);
1358
- };
1359
- }
1360
- });
1361
- const _hoisted_1$1 = { class: "flex justify-content-center align-items-center min-vh-100 px-1 py-2" };
1362
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
1363
- __name: "ResetPasswordPage",
1364
- props: {
1365
- texts: {},
1366
- cardWidth: { default: "450px" },
1367
- cardShadow: { type: Boolean, default: true }
1368
- },
1369
- setup(__props) {
1370
- const router2 = vueRouter.useRouter();
1371
- const route = vueRouter.useRoute();
1372
- const token = vue.computed(() => route.query.token);
1373
- function switchForm(form) {
1374
- if (form === "login") {
1375
- router2.push("/login");
1376
- }
1377
- }
1378
- return (_ctx, _cache) => {
1379
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
1380
- vue.createVNode(vue.unref(vue$1.Card), {
1381
- class: vue.normalizeClass([{ shadow: _ctx.cardShadow }, "p-2"]),
1382
- style: vue.normalizeStyle({ width: _ctx.cardWidth, maxWidth: "100%" })
1383
- }, {
1384
- default: vue.withCtx(() => [
1385
- vue.createVNode(_sfc_main$6, {
1386
- texts: _ctx.texts,
1387
- token: token.value,
1388
- onSwitchForm: switchForm
1389
- }, null, 8, ["texts", "token"])
1390
- ]),
1391
- _: 1
1392
- }, 8, ["class", "style"])
1393
- ]);
1394
- };
1395
- }
1396
- });
1397
- const _hoisted_1 = { class: "flex justify-content-center align-items-center min-vh-100 px-1 py-2" };
1398
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1399
- __name: "SignupPage",
1400
- props: {
1401
- texts: {},
1402
- showNames: { type: Boolean, default: true },
1403
- cardWidth: { default: "450px" },
1404
- cardShadow: { type: Boolean, default: true }
1405
- },
1406
- setup(__props) {
1407
- const router2 = vueRouter.useRouter();
1408
- function switchForm(form) {
1409
- if (form === "login") {
1410
- router2.push("/login");
1411
- }
1412
- }
1413
- return (_ctx, _cache) => {
1414
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
1415
- vue.createVNode(vue.unref(vue$1.Card), {
1416
- class: vue.normalizeClass([{ shadow: _ctx.cardShadow }, "p-2"]),
1417
- style: vue.normalizeStyle({ width: _ctx.cardWidth, maxWidth: "100%" })
1418
- }, {
1419
- default: vue.withCtx(() => [
1420
- vue.createVNode(_sfc_main$5, {
1421
- texts: _ctx.texts,
1422
- "show-names": _ctx.showNames,
1423
- onSwitchForm: switchForm
1424
- }, null, 8, ["texts", "show-names"])
1425
- ]),
1426
- _: 1
1427
- }, 8, ["class", "style"])
1428
- ]);
1429
- };
1430
- }
1431
- });
1432
313
  function getRedirectUrl(router2, config) {
1433
314
  const redirect2 = router2.currentRoute.value.query[config.queryKey];
1434
315
  return redirect2 || config.fallback;
@@ -1652,7 +533,7 @@ function createSSOProvider(config) {
1652
533
  const auth = getAuthApi();
1653
534
  const redirectUri = options.redirectUri ?? getDefaultRedirectUri();
1654
535
  const state = options.state ?? generateState();
1655
- const timeout2 = options.popupTimeout ?? 9e4;
536
+ const timeout = options.popupTimeout ?? 9e4;
1656
537
  if (typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
1657
538
  const currentParams = queryParams();
1658
539
  const redirectUrl = currentParams.redirect;
@@ -1675,7 +556,7 @@ function createSSOProvider(config) {
1675
556
  if (!popupWindow) {
1676
557
  throw new PopupBlockedError();
1677
558
  }
1678
- const result = await waitForPopupCallback(popupWindow, config.id, timeout2);
559
+ const result = await waitForPopupCallback(popupWindow, config.id, timeout);
1679
560
  return auth.loginWithSSO(config.id, {
1680
561
  code: result.code,
1681
562
  state: result.state ?? generateState()
@@ -2451,58 +1332,6 @@ const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
2451
1332
  composeGuards,
2452
1333
  resetAuthState
2453
1334
  }, Symbol.toStringTag, { value: "Module" }));
2454
- function createAuthRoutes(config = {}) {
2455
- const {
2456
- basePath = "",
2457
- namePrefix = "",
2458
- routeNames = {},
2459
- layout
2460
- } = config;
2461
- const createRouteName = (name) => namePrefix ? `${namePrefix}${name}` : name;
2462
- const routes = [
2463
- {
2464
- path: `${basePath}/login`,
2465
- name: routeNames.login || createRouteName("Login"),
2466
- component: () => Promise.resolve().then(() => require("./LoginPage-hv1wc54S.cjs")),
2467
- meta: { requiresAuth: false }
2468
- },
2469
- {
2470
- path: `${basePath}/signup`,
2471
- name: routeNames.signup || createRouteName("Signup"),
2472
- component: () => Promise.resolve().then(() => require("./SignupPage-m36w9PLJ.cjs")),
2473
- meta: { requiresAuth: false }
2474
- },
2475
- {
2476
- path: `${basePath}/forgot-password`,
2477
- name: routeNames.forgotPassword || createRouteName("ForgotPassword"),
2478
- component: () => Promise.resolve().then(() => require("./ForgotPasswordPage-BV9tyhHl.cjs")),
2479
- meta: { requiresAuth: false }
2480
- },
2481
- {
2482
- path: `${basePath}/reset-password`,
2483
- name: routeNames.resetPassword || createRouteName("ResetPassword"),
2484
- component: () => Promise.resolve().then(() => require("./ResetPasswordPage-COPrJmW8.cjs")),
2485
- meta: { requiresAuth: false }
2486
- },
2487
- {
2488
- path: `${basePath}/callback`,
2489
- name: routeNames.callback || createRouteName("AuthCallback"),
2490
- component: () => Promise.resolve().then(() => require("./Callback-BHqVaZZm.cjs")),
2491
- meta: { requiresAuth: false }
2492
- }
2493
- ];
2494
- if (layout) {
2495
- return [{
2496
- path: basePath,
2497
- component: layout,
2498
- children: routes.map((route) => ({
2499
- ...route,
2500
- path: route.path.replace(basePath, "")
2501
- }))
2502
- }];
2503
- }
2504
- return routes;
2505
- }
2506
1335
  function createAuthGuard(config = {}) {
2507
1336
  const { redirectTo = "/" } = config;
2508
1337
  return async (to, _from, next) => {
@@ -2517,22 +1346,13 @@ function createAuthGuard(config = {}) {
2517
1346
  }
2518
1347
  exports.AuthApi = AuthApi;
2519
1348
  exports.AuthState = AuthState;
2520
- exports.Callback = _sfc_main$4;
2521
1349
  exports.DEFAULT_AGENT_ID = DEFAULT_AGENT_ID;
2522
1350
  exports.DEFAULT_REDIRECT_CONFIG = DEFAULT_REDIRECT_CONFIG;
2523
- exports.ForgotPasswordForm = _sfc_main$8;
2524
- exports.ForgotPasswordPage = _sfc_main$3;
2525
1351
  exports.INTAKE_WORKFLOW_ID = INTAKE_WORKFLOW_ID;
2526
- exports.LoginForm = _sfc_main$7;
2527
- exports.LoginPage = _sfc_main$2;
2528
1352
  exports.PopupBlockedError = PopupBlockedError;
2529
1353
  exports.PopupClosedError = PopupClosedError;
2530
1354
  exports.PopupTimeoutError = PopupTimeoutError;
2531
- exports.ResetPasswordForm = _sfc_main$6;
2532
- exports.ResetPasswordPage = _sfc_main$1;
2533
1355
  exports.SSOError = SSOError;
2534
- exports.SignupForm = _sfc_main$5;
2535
- exports.SignupPage = _sfc_main;
2536
1356
  exports.StateMismatchError = StateMismatchError;
2537
1357
  exports.accountToUser = accountToUser;
2538
1358
  exports.authGuard = authGuard;
@@ -2540,7 +1360,6 @@ exports.buildLoginQuery = buildLoginQuery;
2540
1360
  exports.composeGuards = composeGuards;
2541
1361
  exports.createAuth = createAuth;
2542
1362
  exports.createAuthGuard = createAuthGuard;
2543
- exports.createAuthRoutes = createAuthRoutes;
2544
1363
  exports.getAllSSOProviders = getAllSSOProviders;
2545
1364
  exports.getRedirectConfig = getRedirectConfig;
2546
1365
  exports.getRedirectUrl = getRedirectUrl;