lets-mfa
Version:
Free, secure, and quick way to add MFA to your existing app. No user migrations or re-architecture needed!
23 lines (22 loc) • 870 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateAuthenticationRequest = void 0;
const node_crypto_1 = require("node:crypto");
/** Produces an Authentication Response from the given values */
function generateAuthenticationRequest(realm, publicKey, domain, accountVault, responseUrl, signedJWT, authPolicy, accountDisplayName, validThrough, logoUrl, requestId) {
return {
realm,
accountDisplayName,
authOrEnroll: "auth",
responseUrl,
domain,
nestedJWT: signedJWT,
publicKey,
accountVault,
validThrough: validThrough || new Date().getTime() + 5 * 60 * 1000,
authPolicy,
logoUrl,
requestId: requestId ? requestId : (0, node_crypto_1.randomUUID)(),
};
}
exports.generateAuthenticationRequest = generateAuthenticationRequest;