@bdking71/spsignature 1.3.4 → 1.3.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
2
|
+
* @file TransactionSigner.ts
|
|
3
3
|
*
|
|
4
4
|
* Provides a secure, auditable digital-signature workflow for SharePoint
|
|
5
5
|
* web parts. The module renders a modal dialog that supports:
|
|
@@ -36,7 +36,7 @@ export interface SignerContext {
|
|
|
36
36
|
channel?: DeliveryChannel;
|
|
37
37
|
/**
|
|
38
38
|
* Whether two-factor authentication is required.
|
|
39
|
-
* Defaults to `
|
|
39
|
+
* **Defaults to `false` (disabled).** Set to `true` to enable TFA.
|
|
40
40
|
*/
|
|
41
41
|
requireTFA?: boolean;
|
|
42
42
|
}
|
|
@@ -90,7 +90,7 @@ export interface AuditEnvelopeRecord {
|
|
|
90
90
|
* payload: { amount: 1500, vendor: "Contoso" },
|
|
91
91
|
* spContext: this.context,
|
|
92
92
|
* channel: "email",
|
|
93
|
-
* requireTFA: true,
|
|
93
|
+
* requireTFA: true, // Enable TFA
|
|
94
94
|
* });
|
|
95
95
|
* ```
|
|
96
96
|
*/
|
package/lib/TransactionSigner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* @file
|
|
3
|
+
* @file TransactionSigner.ts
|
|
4
4
|
*
|
|
5
5
|
* Provides a secure, auditable digital-signature workflow for SharePoint
|
|
6
6
|
* web parts. The module renders a modal dialog that supports:
|
|
@@ -69,7 +69,7 @@ function generateFiveDigitPasscode() {
|
|
|
69
69
|
* payload: { amount: 1500, vendor: "Contoso" },
|
|
70
70
|
* spContext: this.context,
|
|
71
71
|
* channel: "email",
|
|
72
|
-
* requireTFA: true,
|
|
72
|
+
* requireTFA: true, // Enable TFA
|
|
73
73
|
* });
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
@@ -78,9 +78,11 @@ async function promptAndGenerateSecureAudit(context, modalTitle = "Approve Purch
|
|
|
78
78
|
throw new Error("Execution restricted: Valid WebPartContext must be supplied.");
|
|
79
79
|
}
|
|
80
80
|
return new Promise((resolve) => {
|
|
81
|
-
|
|
81
|
+
// TFA is only enabled if explicitly set to true
|
|
82
|
+
const requireTFA = context.requireTFA === true;
|
|
82
83
|
const generatedPasscode = generateFiveDigitPasscode();
|
|
83
84
|
let storedVerificationItemId = undefined;
|
|
85
|
+
console.log("TFA Enabled:", requireTFA); // DEBUG
|
|
84
86
|
// -----------------------------------------------------------------
|
|
85
87
|
// Overlay
|
|
86
88
|
// -----------------------------------------------------------------
|
package/package.json
CHANGED