UNPKG

payloadcms_otp_plugin

Version:

A comprehensive One-Time Password (OTP) authentication plugin for Payload CMS that enables secure passwordless authentication via SMS and email

19 lines (18 loc) 718 B
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { getOtpConfig } from '../../actions/index.js'; import OtpView from './otp-view.js'; const OtpPage = async ({ initialTimer, className = '' })=>{ // Fetch OTP configuration on the server const config = await getOtpConfig(); const otpLength = config?.otpLength || 6; const expiredTime = config ? Math.floor(config.expiredTime / 1000) : initialTimer || 120; // Convert to seconds return /*#__PURE__*/ _jsx(OtpView, { otpLength: otpLength, expiredTime: expiredTime, initialTimer: initialTimer, className: className }); }; export default OtpPage; //# sourceMappingURL=otp-page.js.map