@verdocs/web-sdk 6.10.7 → 6.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Icons-TVvtZ5iL.js → Icons-Zdy_DFce.js} +16 -2
- package/dist/{esm/Icons-BU5rnXp2.js.map → cjs/Icons-Zdy_DFce.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +271 -15
- package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +45 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +302 -19
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
- package/dist/collection/utils/Icons.js +12 -0
- package/dist/collection/utils/Icons.js.map +1 -1
- package/dist/components/{p-bPe0_Dsn.js → p-B8R4luxA.js} +2 -2
- package/dist/components/{p-D-TexkaT.js → p-BXaR1BSS.js} +2 -2
- package/dist/components/{p-DL4-aTsZ.js → p-BYLm9aol.js} +2 -2
- package/dist/components/{p-DiYuPnJJ.js → p-Bp88Loqg.js} +2 -2
- package/dist/components/{p-BYVQkYYg.js → p-C7JN32A9.js} +2 -2
- package/dist/components/{p-BDv5kBUR.js → p-C7k2AOsW.js} +2 -2
- package/dist/components/p-C7k2AOsW.js.map +1 -0
- package/dist/components/{p-DKKsPZnz.js → p-CCr_gliS.js} +2 -2
- package/dist/components/{p-BELGzhZw.js → p-CFau7OiC.js} +2 -2
- package/dist/components/{p-CYvB5bYX.js → p-CtNpZzq1.js} +2 -2
- package/dist/components/{p-B6aUlIQe.js → p-CzKj8wD_.js} +2 -2
- package/dist/components/{p-CZwyK_uo.js → p-DLo5dMNn.js} +2 -2
- package/dist/components/{p-D1cSgqut.js → p-D_FNSGtS.js} +2 -2
- package/dist/components/{p-K_PKw6bs.js → p-DmxiVavg.js} +2 -2
- package/dist/components/{p-D7oMWhqM.js → p-DrNmI7Wz.js} +2 -2
- package/dist/components/{p-DfIxVX8-.js → p-DubfX0n1.js} +2 -2
- package/dist/components/{p-CAGp0qKc.js → p-hxWwaOcD.js} +2 -2
- package/dist/components/{p-BQUZjuoP.js → p-vcHtLpWY.js} +2 -2
- package/dist/components/verdocs-adopt-signature-dialog.js +1 -1
- package/dist/components/verdocs-auth.js +1 -1
- package/dist/components/verdocs-auth.js.map +1 -1
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -1
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-payment.js +1 -1
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-field-textarea.js +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-file-chooser.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-template-attachments.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/custom-elements.json +2508 -0
- package/dist/esm/{Icons-BU5rnXp2.js → Icons-DobS6Y7w.js} +15 -3
- package/dist/{cjs/Icons-TVvtZ5iL.js.map → esm/Icons-DobS6Y7w.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +273 -17
- package/dist/esm/verdocs-auth.entry.js.map +1 -1
- package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{Icons-BU5rnXp2.js → Icons-DobS6Y7w.js} +2 -2
- package/dist/esm-es5/{Icons-BU5rnXp2.js.map → Icons-DobS6Y7w.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +31 -3
- package/dist/types/components.d.ts +18 -7
- package/dist/types/utils/Icons.d.ts +2 -0
- package/dist/verdocs-web-sdk/{p-869024e0.system.entry.js → p-09f5670e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-0fb8e6e0.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-0fb8e6e0.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-fad90cf9.system.entry.js → p-298d799f.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-734c8a8b.entry.js → p-2a6a3bc6.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-62464041.system.entry.js → p-439d36b0.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d95705c6.entry.js → p-4930b31d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c86111fd.system.entry.js → p-5404f6bf.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-10d47bbd.entry.js → p-5cad2422.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4e091415.entry.js → p-932e8b9b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6e8ce989.system.entry.js → p-99f7a0fa.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-GqS1qR-V.system.js → p-BHF3ByWV.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-GqS1qR-V.system.js.map → p-BHF3ByWV.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-BU5rnXp2.js → p-DobS6Y7w.js} +2 -2
- package/dist/verdocs-web-sdk/{p-BU5rnXp2.js.map → p-DobS6Y7w.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c3e9634c.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-c3e9634c.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7e1f895c.entry.js → p-dd59aa9a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ceda04bc.system.entry.js → p-f7b14409.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ee92c074.entry.js → p-fe404347.entry.js} +2 -2
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +4 -4
- package/dist/components/p-BDv5kBUR.js.map +0 -1
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js.map +0 -1
- /package/dist/components/{p-bPe0_Dsn.js.map → p-B8R4luxA.js.map} +0 -0
- /package/dist/components/{p-D-TexkaT.js.map → p-BXaR1BSS.js.map} +0 -0
- /package/dist/components/{p-DL4-aTsZ.js.map → p-BYLm9aol.js.map} +0 -0
- /package/dist/components/{p-DiYuPnJJ.js.map → p-Bp88Loqg.js.map} +0 -0
- /package/dist/components/{p-BYVQkYYg.js.map → p-C7JN32A9.js.map} +0 -0
- /package/dist/components/{p-DKKsPZnz.js.map → p-CCr_gliS.js.map} +0 -0
- /package/dist/components/{p-BELGzhZw.js.map → p-CFau7OiC.js.map} +0 -0
- /package/dist/components/{p-CYvB5bYX.js.map → p-CtNpZzq1.js.map} +0 -0
- /package/dist/components/{p-B6aUlIQe.js.map → p-CzKj8wD_.js.map} +0 -0
- /package/dist/components/{p-CZwyK_uo.js.map → p-DLo5dMNn.js.map} +0 -0
- /package/dist/components/{p-D1cSgqut.js.map → p-D_FNSGtS.js.map} +0 -0
- /package/dist/components/{p-K_PKw6bs.js.map → p-DmxiVavg.js.map} +0 -0
- /package/dist/components/{p-D7oMWhqM.js.map → p-DrNmI7Wz.js.map} +0 -0
- /package/dist/components/{p-DfIxVX8-.js.map → p-DubfX0n1.js.map} +0 -0
- /package/dist/components/{p-CAGp0qKc.js.map → p-hxWwaOcD.js.map} +0 -0
- /package/dist/components/{p-BQUZjuoP.js.map → p-vcHtLpWY.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-869024e0.system.entry.js.map → p-09f5670e.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fad90cf9.system.entry.js.map → p-298d799f.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-734c8a8b.entry.js.map → p-2a6a3bc6.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-62464041.system.entry.js.map → p-439d36b0.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d95705c6.entry.js.map → p-4930b31d.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c86111fd.system.entry.js.map → p-5404f6bf.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-10d47bbd.entry.js.map → p-5cad2422.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4e091415.entry.js.map → p-932e8b9b.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-6e8ce989.system.entry.js.map → p-99f7a0fa.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7e1f895c.entry.js.map → p-dd59aa9a.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ceda04bc.system.entry.js.map → p-f7b14409.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ee92c074.entry.js.map → p-fe404347.entry.js.map} +0 -0
|
@@ -2,11 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DLmnUl1_.js');
|
|
4
4
|
var jsSdk = require('@verdocs/js-sdk');
|
|
5
|
+
var Icons = require('./Icons-Zdy_DFce.js');
|
|
5
6
|
var Toast = require('./Toast-BgG-6jAg.js');
|
|
6
7
|
var errors = require('./errors-D1XRvnet.js');
|
|
7
8
|
|
|
8
|
-
const verdocsAuthCss = () => `verdocs-auth{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{width:350px;display:-ms-flexbox;display:flex;padding:20px;max-width:90%;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;background:#ffffff}verdocs-auth .logo{width:128px;max-width:100%;margin:20px 0 30px}verdocs-auth h3{color:#092c4c;text-align:center;font-weight:400;font-size:18px;line-height:1.75;margin:0}verdocs-auth em{font-size:14px;margin:15px 0}verdocs-auth .buttons{gap:20px;margin:20px 0 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p{color:#092c4c;margin:1em 0;font-size:14px}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}verdocs-auth .already-have{color:#092c4c;margin:0.5em 0;font-size:14px;text-align:center}verdocs-auth .service-agreement{font-size:12px;color:#777}verdocs-auth .service-agreement a{color:#092c4c}`;
|
|
9
|
+
const verdocsAuthCss = () => `verdocs-auth{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{width:350px;display:-ms-flexbox;display:flex;padding:20px;max-width:90%;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;background:#ffffff}verdocs-auth .logo{width:128px;max-width:100%;margin:20px 0 30px}verdocs-auth h3{color:#092c4c;text-align:center;font-weight:400;font-size:18px;line-height:1.75;margin:0 0 20px 0}verdocs-auth em{font-size:14px;margin:15px 0}verdocs-auth .buttons{gap:20px;margin:20px 0 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p{color:#092c4c;margin:1em 0;font-size:14px}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}verdocs-auth .already-have{color:#092c4c;margin:0.5em 0;font-size:14px;text-align:center}verdocs-auth .service-agreement{font-size:12px;color:#777}verdocs-auth .service-agreement a{color:#092c4c}verdocs-auth .providers{width:100%}verdocs-auth .providers verdocs-button{display:block;margin-bottom:10px}verdocs-auth .providers verdocs-button button.outline{position:relative;border-color:#aeb4bf}verdocs-auth .providers verdocs-button button.outline:disabled{border-color:#aeb4bf}verdocs-auth .providers verdocs-button .icon.start{position:absolute;left:16px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}verdocs-auth .providers verdocs-button .icon.start svg{width:18px;height:18px}verdocs-auth .divider{gap:8px;color:#777;display:-ms-flexbox;display:flex;font-size:12px;margin:28px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-auth .divider .divider-line{-ms-flex:1;flex:1;height:1px;background:#aeb4bf}verdocs-auth .mfa-error{color:#cc0000;font-size:14px;margin:0 0 8px}`;
|
|
9
10
|
|
|
11
|
+
const MFA_CODE_ERROR = 'Invalid code. Please try again.';
|
|
12
|
+
const SOCIAL_START_ERROR = 'Unable to start sign-in sequence. Please try again.';
|
|
13
|
+
const SOCIAL_LOGIN_KEY = 'vdocs-social-login';
|
|
14
|
+
const SOCIAL_ERROR_MESSAGES = {
|
|
15
|
+
email_unverified: 'That account does not have a verified email address.',
|
|
16
|
+
corporate_email_required: 'Please use your corporate email address to create an account.',
|
|
17
|
+
account_locked: 'That account is locked. Please contact support@verdocs.com.',
|
|
18
|
+
provider_error: 'That provider could not sign you in. Please try again.',
|
|
19
|
+
access_denied: 'Sign-in was canceled.',
|
|
20
|
+
};
|
|
21
|
+
const socialErrorMessage = (code) => SOCIAL_ERROR_MESSAGES[code] || 'Unable to sign in. Please try again.';
|
|
22
|
+
const readSocialLoginAttempt = () => {
|
|
23
|
+
try {
|
|
24
|
+
const stored = window.sessionStorage.getItem(SOCIAL_LOGIN_KEY);
|
|
25
|
+
return stored ? JSON.parse(stored) : null;
|
|
26
|
+
}
|
|
27
|
+
catch (_a) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const clearSocialLoginAttempt = () => {
|
|
32
|
+
try {
|
|
33
|
+
window.sessionStorage.removeItem(SOCIAL_LOGIN_KEY);
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
// Third-party embeds may block sessionStorage. It's OK.
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
// Prevent replays on a reload
|
|
40
|
+
const cleanSocialLoginParams = (names) => {
|
|
41
|
+
const url = new URL(window.location.href);
|
|
42
|
+
names.forEach(name => url.searchParams.delete(name));
|
|
43
|
+
window.history.replaceState({}, '', `${url.pathname}${url.search}${url.hash}`);
|
|
44
|
+
};
|
|
45
|
+
const currentReturnUri = () => `${window.location.origin}${window.location.pathname}`;
|
|
46
|
+
const formatRecoveryCode = (value) => {
|
|
47
|
+
const cleaned = value
|
|
48
|
+
.toLowerCase()
|
|
49
|
+
.replace(/[^a-z0-9]/g, '')
|
|
50
|
+
.slice(0, 8);
|
|
51
|
+
return cleaned.length > 4 ? `${cleaned.slice(0, 4)}-${cleaned.slice(4)}` : cleaned;
|
|
52
|
+
};
|
|
10
53
|
const VerdocsAuth = class {
|
|
11
54
|
constructor(hostRef) {
|
|
12
55
|
index.registerInstance(this, hostRef);
|
|
@@ -32,6 +75,12 @@ const VerdocsAuth = class {
|
|
|
32
75
|
* The display mode to start in.
|
|
33
76
|
*/
|
|
34
77
|
this.displayMode = 'login';
|
|
78
|
+
/**
|
|
79
|
+
* Social auth is disabled by default because these are redirect flows that require allowable redirect_uri
|
|
80
|
+
* destinations be pre-registered. These will only work on Verdocs sites/apps, so third-party developers
|
|
81
|
+
* should not turn this on unless instructed to by Verdocs Support.
|
|
82
|
+
*/
|
|
83
|
+
this.showSocialLogins = false;
|
|
35
84
|
this.org_name = '';
|
|
36
85
|
this.first_name = '';
|
|
37
86
|
this.last_name = '';
|
|
@@ -45,7 +94,14 @@ const VerdocsAuth = class {
|
|
|
45
94
|
this.resendDisabled = false;
|
|
46
95
|
this.session = null;
|
|
47
96
|
this.profile = null;
|
|
97
|
+
this.providers = { google: false, microsoft: false };
|
|
98
|
+
this.mfaToken = '';
|
|
99
|
+
this.mfaCode = '';
|
|
100
|
+
this.recoveryCode = '';
|
|
101
|
+
this.useRecoveryCode = false;
|
|
102
|
+
this.mfaError = '';
|
|
48
103
|
this.resendDisabledTimer = null;
|
|
104
|
+
this.mfaFocusPending = false;
|
|
49
105
|
// We can't instantly log in on the default endpoint because other listeners might see
|
|
50
106
|
// its events and incorrectly trigger before we're done. So we manage our own temp
|
|
51
107
|
// endpoint and pass the final tokens to the default once we're ready.
|
|
@@ -75,6 +131,33 @@ const VerdocsAuth = class {
|
|
|
75
131
|
(_b = this.authenticated) === null || _b === void 0 ? void 0 : _b.emit({ authenticated: false, session, profile });
|
|
76
132
|
}
|
|
77
133
|
});
|
|
134
|
+
if (this.showSocialLogins) {
|
|
135
|
+
jsSdk.getSocialProviders(this.endpoint)
|
|
136
|
+
.then(providers => {
|
|
137
|
+
this.providers = providers;
|
|
138
|
+
})
|
|
139
|
+
.catch(() => undefined);
|
|
140
|
+
}
|
|
141
|
+
this.handleSocialLoginReturn();
|
|
142
|
+
}
|
|
143
|
+
componentDidRender() {
|
|
144
|
+
if (this.displayMode !== 'mfa') {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const input = this.el.querySelector('.mfa-input input');
|
|
148
|
+
if (!input) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (!this.useRecoveryCode) {
|
|
152
|
+
input.setAttribute('inputmode', 'numeric');
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
input.removeAttribute('inputmode');
|
|
156
|
+
}
|
|
157
|
+
if (this.mfaFocusPending) {
|
|
158
|
+
this.mfaFocusPending = false;
|
|
159
|
+
input.focus();
|
|
160
|
+
}
|
|
78
161
|
}
|
|
79
162
|
disconnectedCallback() {
|
|
80
163
|
if (typeof window !== 'undefined') {
|
|
@@ -166,9 +249,24 @@ const VerdocsAuth = class {
|
|
|
166
249
|
}
|
|
167
250
|
completeLogin(result) {
|
|
168
251
|
this.clearForms();
|
|
252
|
+
this.displayMode = 'login';
|
|
169
253
|
this.tempAuthEndpoint.clearSession();
|
|
170
254
|
this.endpoint.setToken(result.access_token);
|
|
171
255
|
}
|
|
256
|
+
async finishLogin(authResult) {
|
|
257
|
+
console.log('[AUTH] Authenticated, checking email verification');
|
|
258
|
+
this.tempAuthEndpoint.setToken(authResult.access_token);
|
|
259
|
+
const user = await jsSdk.getMyUser(this.tempAuthEndpoint);
|
|
260
|
+
this.submitting = false;
|
|
261
|
+
if (!user.email_verified) {
|
|
262
|
+
console.log('[AUTH] Logged in, pending email address verification');
|
|
263
|
+
this.displayMode = 'verify';
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
console.log('[AUTH] Email address is verified, completing login');
|
|
267
|
+
this.completeLogin(authResult);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
172
270
|
async loginAndCheckVerification() {
|
|
173
271
|
var _a;
|
|
174
272
|
if (this.submitting) {
|
|
@@ -177,29 +275,170 @@ const VerdocsAuth = class {
|
|
|
177
275
|
this.submitting = true;
|
|
178
276
|
this.tempAuthEndpoint.clearSession();
|
|
179
277
|
try {
|
|
180
|
-
this.submitting = false;
|
|
181
278
|
const authResult = await jsSdk.authenticate(this.tempAuthEndpoint, { username: this.email.trim(), password: this.password, grant_type: 'password' });
|
|
182
|
-
|
|
183
|
-
this.tempAuthEndpoint.setToken(authResult.access_token);
|
|
184
|
-
const user = await jsSdk.getMyUser(this.tempAuthEndpoint);
|
|
185
|
-
if (!user.email_verified) {
|
|
186
|
-
console.log('[AUTH] Logged in, pending email address verification');
|
|
187
|
-
this.displayMode = 'verify';
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
console.log('[AUTH] Email address is verified, completing login');
|
|
191
|
-
this.completeLogin(authResult);
|
|
192
|
-
}
|
|
279
|
+
await this.finishLogin(authResult);
|
|
193
280
|
}
|
|
194
281
|
catch (e) {
|
|
282
|
+
if (jsSdk.isMFARequired(e)) {
|
|
283
|
+
this.startMFA(e.response.data.mfa_token);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
195
286
|
this.submitting = false;
|
|
196
287
|
console.log('[AUTH] Auth failure', ((_a = e.response) === null || _a === void 0 ? void 0 : _a.data) || e);
|
|
197
288
|
Toast.VerdocsToast('Login failed. Please check your credentials and try again.', { style: 'error' });
|
|
198
289
|
}
|
|
199
290
|
}
|
|
291
|
+
startMFA(token) {
|
|
292
|
+
this.mfaToken = token;
|
|
293
|
+
this.mfaCode = '';
|
|
294
|
+
this.recoveryCode = '';
|
|
295
|
+
this.useRecoveryCode = false;
|
|
296
|
+
this.mfaError = '';
|
|
297
|
+
this.submitting = false;
|
|
298
|
+
this.mfaFocusPending = true;
|
|
299
|
+
this.displayMode = 'mfa';
|
|
300
|
+
}
|
|
301
|
+
returnToLogin() {
|
|
302
|
+
this.mfaToken = '';
|
|
303
|
+
this.mfaCode = '';
|
|
304
|
+
this.recoveryCode = '';
|
|
305
|
+
this.useRecoveryCode = false;
|
|
306
|
+
this.mfaError = '';
|
|
307
|
+
this.password = '';
|
|
308
|
+
this.submitting = false;
|
|
309
|
+
this.displayMode = 'login';
|
|
310
|
+
}
|
|
311
|
+
handleMFAFailure(e) {
|
|
312
|
+
var _a;
|
|
313
|
+
this.submitting = false;
|
|
314
|
+
this.mfaCode = '';
|
|
315
|
+
this.recoveryCode = '';
|
|
316
|
+
// Failed attempts require a fresh token
|
|
317
|
+
if (jsSdk.isMFARequired(e)) {
|
|
318
|
+
this.mfaToken = e.response.data.mfa_token;
|
|
319
|
+
this.mfaError = MFA_CODE_ERROR;
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if (((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
|
|
323
|
+
this.returnToLogin();
|
|
324
|
+
Toast.VerdocsToast('Your sign-in timed out. Enter your password again.', { style: 'error' });
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
this.mfaError = MFA_CODE_ERROR;
|
|
328
|
+
}
|
|
329
|
+
async submitMFA(code, isRecoveryCode) {
|
|
330
|
+
if (this.submitting || !code) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
this.submitting = true;
|
|
334
|
+
this.mfaError = '';
|
|
335
|
+
this.tempAuthEndpoint.clearSession();
|
|
336
|
+
try {
|
|
337
|
+
const authResult = await jsSdk.authenticate(this.tempAuthEndpoint, isRecoveryCode
|
|
338
|
+
? { grant_type: 'urn:verdocs:params:oauth:grant-type:mfa-recovery-code', mfa_token: this.mfaToken, recovery_code: code }
|
|
339
|
+
: { grant_type: 'urn:verdocs:params:oauth:grant-type:mfa-otp', mfa_token: this.mfaToken, otp: code });
|
|
340
|
+
await this.finishLogin(authResult);
|
|
341
|
+
}
|
|
342
|
+
catch (e) {
|
|
343
|
+
this.handleMFAFailure(e);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
handleVerifyMFA() {
|
|
347
|
+
this.submitMFA(this.useRecoveryCode ? this.recoveryCode : this.mfaCode, this.useRecoveryCode).catch(() => undefined);
|
|
348
|
+
}
|
|
349
|
+
handleMFACodeInput(target) {
|
|
350
|
+
const digits = (target.value || '').replace(/\D/g, '').slice(0, 6);
|
|
351
|
+
if (target.value !== digits) {
|
|
352
|
+
target.value = digits;
|
|
353
|
+
}
|
|
354
|
+
this.mfaCode = digits;
|
|
355
|
+
// Auto-submit once 6 digits are entered
|
|
356
|
+
if (digits.length === 6) {
|
|
357
|
+
this.submitMFA(digits, false).catch(() => undefined);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
handleRecoveryCodeInput(target) {
|
|
361
|
+
const formatted = formatRecoveryCode(target.value || '');
|
|
362
|
+
if (target.value !== formatted) {
|
|
363
|
+
target.value = formatted;
|
|
364
|
+
}
|
|
365
|
+
this.recoveryCode = formatted;
|
|
366
|
+
}
|
|
367
|
+
toggleRecoveryCode() {
|
|
368
|
+
this.useRecoveryCode = !this.useRecoveryCode;
|
|
369
|
+
this.mfaCode = '';
|
|
370
|
+
this.recoveryCode = '';
|
|
371
|
+
this.mfaError = '';
|
|
372
|
+
this.mfaFocusPending = true;
|
|
373
|
+
}
|
|
374
|
+
handleSocialLogin(provider) {
|
|
375
|
+
try {
|
|
376
|
+
const verifier = jsSdk.createCodeVerifier();
|
|
377
|
+
const state = jsSdk.createCodeVerifier();
|
|
378
|
+
jsSdk.createCodeChallenge(verifier)
|
|
379
|
+
.then(codeChallenge => {
|
|
380
|
+
const attempt = { verifier, state, provider };
|
|
381
|
+
window.sessionStorage.setItem(SOCIAL_LOGIN_KEY, JSON.stringify(attempt));
|
|
382
|
+
window.location.assign(jsSdk.getSocialLoginUrl(this.endpoint, provider, { returnUri: currentReturnUri(), codeChallenge, state }));
|
|
383
|
+
})
|
|
384
|
+
.catch(() => Toast.VerdocsToast(SOCIAL_START_ERROR, { style: 'error' }));
|
|
385
|
+
}
|
|
386
|
+
catch (_a) {
|
|
387
|
+
Toast.VerdocsToast(SOCIAL_START_ERROR, { style: 'error' });
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
handleSocialLoginReturn() {
|
|
391
|
+
if (typeof window === 'undefined') {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const params = new URLSearchParams(window.location.search);
|
|
395
|
+
const loginCode = params.get('login_code');
|
|
396
|
+
const state = params.get('state');
|
|
397
|
+
const error = params.get('error');
|
|
398
|
+
if (!loginCode && !error) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
const attempt = readSocialLoginAttempt();
|
|
402
|
+
// `error` doesn't give us the whole picture
|
|
403
|
+
if (!loginCode && !attempt) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
clearSocialLoginAttempt();
|
|
407
|
+
cleanSocialLoginParams(loginCode ? ['login_code', 'state'] : ['error']);
|
|
408
|
+
if (error) {
|
|
409
|
+
Toast.VerdocsToast(socialErrorMessage(error), { style: 'error' });
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
if (!attempt || attempt.state !== state) {
|
|
413
|
+
Toast.VerdocsToast('Sign-in could not be verified. Try again.', { style: 'error' });
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
this.exchangeLoginCode(loginCode, attempt.verifier);
|
|
417
|
+
}
|
|
418
|
+
exchangeLoginCode(loginCode, codeVerifier) {
|
|
419
|
+
this.submitting = true;
|
|
420
|
+
this.tempAuthEndpoint.clearSession();
|
|
421
|
+
jsSdk.authenticate(this.tempAuthEndpoint, { grant_type: 'urn:verdocs:params:oauth:grant-type:login-code', login_code: loginCode, code_verifier: codeVerifier })
|
|
422
|
+
.then(authResult => this.finishLogin(authResult))
|
|
423
|
+
.catch(e => {
|
|
424
|
+
var _a;
|
|
425
|
+
if (jsSdk.isMFARequired(e)) {
|
|
426
|
+
this.startMFA(e.response.data.mfa_token);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
this.submitting = false;
|
|
430
|
+
console.log('[AUTH] Social login failure', ((_a = e.response) === null || _a === void 0 ? void 0 : _a.data) || e);
|
|
431
|
+
Toast.VerdocsToast('Sign-in failed. Please try again.', { style: 'error' });
|
|
432
|
+
});
|
|
433
|
+
}
|
|
200
434
|
clearForms() {
|
|
201
435
|
this.submitting = false;
|
|
202
436
|
this.resendDisabled = false;
|
|
437
|
+
this.mfaToken = '';
|
|
438
|
+
this.mfaCode = '';
|
|
439
|
+
this.recoveryCode = '';
|
|
440
|
+
this.useRecoveryCode = false;
|
|
441
|
+
this.mfaError = '';
|
|
203
442
|
this.email = '';
|
|
204
443
|
this.phone = '';
|
|
205
444
|
this.password = '';
|
|
@@ -315,6 +554,12 @@ const VerdocsAuth = class {
|
|
|
315
554
|
Toast.VerdocsToast('Unable to reset password. Please check your email address and try again.', { style: 'error' });
|
|
316
555
|
}
|
|
317
556
|
}
|
|
557
|
+
renderProviderButtons() {
|
|
558
|
+
if (!this.showSocialLogins || (!this.providers.google && !this.providers.microsoft)) {
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
return (index.h("div", { class: "providers" }, this.providers.google && (index.h("verdocs-button", { label: "Continue with Google", variant: "outline", class: "provider-google", startIcon: Icons.GoogleIcon, disabled: this.submitting, onClick: () => this.handleSocialLogin('google') })), this.providers.microsoft && (index.h("verdocs-button", { label: "Continue with Microsoft", variant: "outline", class: "provider-microsoft", startIcon: Icons.MicrosoftIcon, disabled: this.submitting, onClick: () => this.handleSocialLogin('microsoft') })), index.h("div", { class: "divider" }, index.h("div", { class: "divider-line" }), "or", index.h("div", { class: "divider-line" }))));
|
|
562
|
+
}
|
|
318
563
|
render() {
|
|
319
564
|
if (!this.visible) {
|
|
320
565
|
return index.h("div", { style: { display: 'none' } }, "Authenticated");
|
|
@@ -322,9 +567,19 @@ const VerdocsAuth = class {
|
|
|
322
567
|
if (this.session) {
|
|
323
568
|
return (index.h("verdocs-button", { label: "Sign Out", disabled: this.submitting, onClick: () => this.handleLogout(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }));
|
|
324
569
|
}
|
|
570
|
+
if (this.displayMode === 'mfa') {
|
|
571
|
+
const enteredCode = this.useRecoveryCode ? this.recoveryCode : this.mfaCode;
|
|
572
|
+
const codeComplete = this.useRecoveryCode ? this.recoveryCode.replace('-', '').length === 8 : this.mfaCode.length === 6;
|
|
573
|
+
return (index.h("div", { class: "form" }, index.h("a", { href: "https://verdocs.com/en/" }, index.h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), index.h("h3", null, "Two-factor authentication"), index.h("p", null, this.useRecoveryCode
|
|
574
|
+
? 'Enter one of the backup codes you saved when you turned on multi-factor authentication.'
|
|
575
|
+
: 'Enter the six-digit code from your authenticator app.'), index.h("form", { onSubmit: (e) => {
|
|
576
|
+
e.preventDefault();
|
|
577
|
+
this.handleVerifyMFA();
|
|
578
|
+
} }, this.useRecoveryCode ? (index.h("verdocs-text-input", { class: "mfa-input", label: "Backup code", placeholder: "xxxx-xxxx", autocomplete: "one-time-code", value: this.recoveryCode, onInput: (e) => this.handleRecoveryCodeInput(e.target), disabled: this.submitting })) : (index.h("verdocs-text-input", { class: "mfa-input", label: "Authentication code", autocomplete: "one-time-code", value: this.mfaCode, onInput: (e) => this.handleMFACodeInput(e.target), disabled: this.submitting })), this.mfaError && (index.h("div", { role: "alert", class: "mfa-error" }, this.mfaError)), index.h("div", { class: "buttons" }, index.h("verdocs-button", { label: "Cancel", variant: "outline", disabled: this.submitting, onClick: () => this.returnToLogin() }), index.h("verdocs-button", { label: "Verify", disabled: this.submitting || !codeComplete || !enteredCode, onClick: () => this.handleVerifyMFA() })), index.h("div", { class: "buttons" }, index.h("verdocs-button", { variant: "text", size: "small", label: this.useRecoveryCode ? 'Use your authenticator app instead' : 'Use a backup code instead', disabled: this.submitting, onClick: () => this.toggleRecoveryCode() })))));
|
|
579
|
+
}
|
|
325
580
|
if (this.displayMode === 'signup') {
|
|
326
581
|
const invalid = this.submitting || !this.first_name || !this.last_name || !this.email || !this.password || !this.confirmpass || !this.org_name;
|
|
327
|
-
return (index.h("div", { class: "form" }, index.h("a", { href: "https://verdocs.com/en/" }, index.h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), index.h("h3", null, "Sign up for a free account"), index.h("div", { class: "already-have" }, "Already have an account?", index.h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), index.h("form", { onSubmit: () => this.handleSignup() }, index.h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, index.h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first_name, onInput: (e) => (this.first_name = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last_name, onInput: (e) => (this.last_name = e.target.value), disabled: this.submitting })), index.h("verdocs-text-input", { label: "Email Address", autocomplete: "email", required: true, value: this.email, onInput: (e) => (this.email = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "new-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Confirm Password", type: "password", required: true, autocomplete: "off", value: this.confirmpass, onInput: (e) => (this.confirmpass = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Phone Number", type: "tel", required: true, autocomplete: "phone", value: this.phone, onInput: (e) => (this.phone = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.org_name, onInput: (e) => (this.org_name = e.target.value), disabled: this.submitting, style: { flex: '1' } }), index.h("div", { class: "service-agreement" }, "By clicking the Create Account button, you agree to the", ' ', index.h("a", { href: "https://verdocs.com/eula", target: "_blank" }, "End User License Agreement"), ". Learn about how we use and protect your data and how you can opt-out in our", ' ', index.h("a", { href: "https://verdocs.com/privacy-policy", target: "_blank" }, "Privacy Policy"), "."), index.h("div", { style: { marginTop: '30px' } }), index.h("verdocs-button", { label: "Next", disabled: invalid, onClick: invalid ? () => { } : () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))));
|
|
582
|
+
return (index.h("div", { class: "form" }, index.h("a", { href: "https://verdocs.com/en/" }, index.h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), index.h("h3", null, "Sign up for a free account"), index.h("div", { class: "already-have" }, "Already have an account?", index.h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), this.renderProviderButtons(), index.h("form", { onSubmit: () => this.handleSignup() }, index.h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, index.h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first_name, onInput: (e) => (this.first_name = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last_name, onInput: (e) => (this.last_name = e.target.value), disabled: this.submitting })), index.h("verdocs-text-input", { label: "Email Address", autocomplete: "email", required: true, value: this.email, onInput: (e) => (this.email = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "new-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Confirm Password", type: "password", required: true, autocomplete: "off", value: this.confirmpass, onInput: (e) => (this.confirmpass = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Phone Number", type: "tel", required: true, autocomplete: "phone", value: this.phone, onInput: (e) => (this.phone = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.org_name, onInput: (e) => (this.org_name = e.target.value), disabled: this.submitting, style: { flex: '1' } }), index.h("div", { class: "service-agreement" }, "By clicking the Create Account button, you agree to the", ' ', index.h("a", { href: "https://verdocs.com/eula", target: "_blank" }, "End User License Agreement"), ". Learn about how we use and protect your data and how you can opt-out in our", ' ', index.h("a", { href: "https://verdocs.com/privacy-policy", target: "_blank" }, "Privacy Policy"), "."), index.h("div", { style: { marginTop: '30px' } }), index.h("verdocs-button", { label: "Next", disabled: invalid, onClick: invalid ? () => { } : () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))));
|
|
328
583
|
}
|
|
329
584
|
if (this.displayMode === 'verify') {
|
|
330
585
|
return (index.h("div", { class: "form" }, index.h("form", { onSubmit: () => this.handleVerification() }, index.h("p", null, "Please check your e-mail inbox for a verification code and enter it below."), index.h("verdocs-text-input", { label: "Verification Code", required: true, value: this.verificationCode, onInput: (e) => (this.verificationCode = e.target.value), disabled: this.submitting }), index.h("div", { class: "buttons" }, index.h("verdocs-button", { label: "Sign Out", variant: "outline", disabled: this.submitting, onClick: () => this.handleLogout() }), index.h("verdocs-button", { label: "Verify", disabled: this.submitting || !this.verificationCode || this.verificationCode.length !== 6, onClick: () => this.handleVerification() })), index.h("div", { class: "buttons" }, index.h("verdocs-button", { variant: "text", label: "Resend Code", disabled: this.resendDisabled || this.submitting, onClick: () => this.handleResendVerification() })))));
|
|
@@ -335,8 +590,9 @@ const VerdocsAuth = class {
|
|
|
335
590
|
if (this.displayMode === 'reset') {
|
|
336
591
|
return (index.h("div", { class: "form" }, index.h("a", { href: "https://verdocs.com/en/" }, index.h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), index.h("h3", null, "Forgot your password?"), index.h("p", null, "Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not receive the message."), index.h("form", { onSubmit: () => this.handleResetPassword() }, index.h("verdocs-text-input", { label: "Verification Code", required: true, value: this.verificationCode, onInput: (e) => (this.verificationCode = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "off", value: this.newPassword, onInput: (e) => (this.newPassword = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Confirm Password", type: "password", required: true, autocomplete: "off", value: this.confirmpass, onInput: (e) => (this.confirmpass = e.target.value), disabled: this.submitting }), index.h("div", { style: { marginTop: '30px' } }), index.h("div", { class: "buttons" }, index.h("verdocs-button", { label: "Cancel", variant: "outline", disabled: this.submitting, onClick: () => (this.displayMode = 'login') }), index.h("verdocs-button", { label: "Reset", disabled: this.submitting, onClick: () => this.handleResetPassword() })), index.h("div", { class: "buttons" }, index.h("verdocs-button", { variant: "text", label: "Resend Code", disabled: this.resendDisabled || this.submitting, onClick: () => this.handleResendReset() })))));
|
|
337
592
|
}
|
|
338
|
-
return (index.h("div", { class: "form" }, index.h("a", { href: "https://verdocs.com/en/" }, index.h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), index.h("h3", null, "Log in to your account"),
|
|
593
|
+
return (index.h("div", { class: "form" }, index.h("a", { href: "https://verdocs.com/en/" }, index.h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), index.h("h3", null, "Log in to your account"), this.renderProviderButtons(), index.h("form", { onSubmit: () => this.loginAndCheckVerification() }, index.h("verdocs-text-input", { label: "Email", autocomplete: "username", value: this.email, onInput: (e) => (this.email = e.target.value), disabled: this.submitting }), index.h("verdocs-text-input", { label: "Password", type: "password", autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), index.h("verdocs-button", { label: "Forgot Your Password?", variant: "text", onClick: () => (this.displayMode = 'forgot'), disabled: this.submitting, style: { display: 'flex', justifyContent: 'center', margin: '0 auto 20px' } }), index.h("verdocs-button", { label: "Login", disabled: this.submitting, onClick: () => this.loginAndCheckVerification(), style: { display: 'flex', justifyContent: 'center', margin: '10px auto 0' } }), index.h("verdocs-button", { label: "Sign Up", variant: "outline", disabled: this.submitting, onClick: () => (this.displayMode = 'signup'), style: { display: 'flex', justifyContent: 'center', margin: '10px auto 0' } }))));
|
|
339
594
|
}
|
|
595
|
+
get el() { return index.getElement(this); }
|
|
340
596
|
};
|
|
341
597
|
VerdocsAuth.style = verdocsAuthCss();
|
|
342
598
|
|