synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
90 lines (89 loc) • 2.51 kB
JavaScript
import { jsxs as b, jsx as t } from "react/jsx-runtime";
import I from "../../utils/hooks/useLogin.js";
import { Box as f, Typography as s } from "@mui/material";
import { TOTP_GUIDANCE_TEXT as P, RECOVERY_CODE_GUIDANCE_TEXT_SHORT as _ } from "./Constants.js";
import S from "./LoginFlowBackButton.js";
import U from "./LoginForm.js";
function V(e) {
const {
ssoRedirectUrl: n,
sessionCallback: i,
registerAccountUrl: a,
resetPasswordUrl: m,
onBeginOAuthSignIn: c,
onTwoFactorAuthRequired: d,
hideRegisterButton: u,
hideForgotPasswordButton: g,
ssoState: l,
twoFactorAuthResetUri: p,
onPasswordLoginSelected: h,
realm: R
} = e, {
step: o,
onStepChange: r,
submitUsernameAndPassword: w,
submitOneTimePassword: E,
errorMessage: A,
loginIsPending: F,
beginTwoFactorAuthReset: T,
twoFactorAuthResetIsPending: C,
twoFactorAuthResetIsSuccess: x
} = I({
sessionCallback: i,
twoFaErrorResponse: e.twoFactorAuthenticationRequired,
onTwoFactorAuthRequired: d
});
return /* @__PURE__ */ b(
f,
{
sx: (O) => ({
[O.breakpoints.up("sm")]: {
width: "330px"
},
p: 0,
mx: "auto",
bgColor: "transparent"
}),
children: [
/* @__PURE__ */ t(
S,
{
step: o,
onStepChange: r,
sx: { p: 0, mb: 1 }
}
),
o === "VERIFICATION_CODE" && /* @__PURE__ */ t(s, { variant: "body1", sx: { my: 2 }, align: "center", children: P }),
o === "RECOVERY_CODE" && /* @__PURE__ */ t(s, { variant: "body1", sx: { my: 2 }, align: "center", children: _ }),
/* @__PURE__ */ t(
U,
{
step: o,
onStepChange: r,
submitUsernameAndPassword: w,
submitOneTimePassword: E,
errorMessage: A,
ssoRedirectUrl: n,
registerAccountUrl: a,
resetPasswordUrl: m,
onBeginOAuthSignIn: c,
loginIsPending: F,
beginTwoFactorAuthReset: T,
hideRegisterButton: u,
hideForgotPasswordButton: g,
twoFactorAuthResetIsPending: C,
twoFactorAuthResetIsSuccess: x,
ssoState: l,
twoFactorAuthResetUri: p,
onPasswordLoginSelected: h,
realm: R
}
)
]
}
);
}
export {
V as default
};
//# sourceMappingURL=StandaloneLoginForm.js.map