Login:App:Confirm: add new actions

This commit is contained in:
Darya Umrikhina 2024-08-13 12:41:22 +04:00
parent 3d7a508093
commit bf017647ea
5 changed files with 45 additions and 16 deletions

View File

@ -26,7 +26,7 @@
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { getSettings } from "@/utils/actions";
import { getPortalPasswordSettings, getSettings } from "@/utils/actions";
import ActivateUserForm from "@/components/ActivateUserForm";
import { GreetingCreateUserContainer } from "@/components/GreetingContainer";
@ -37,7 +37,10 @@ type ActivationProps = {
async function Page({ searchParams }: ActivationProps) {
const type = searchParams.type;
const settings = await getSettings();
const [settings, passwordSettings] = await Promise.all([
getSettings(),
getPortalPasswordSettings(),
]);
return (
<div className="content-top">
@ -45,7 +48,10 @@ async function Page({ searchParams }: ActivationProps) {
<>
<GreetingCreateUserContainer type={type} />
<FormWrapper id="activation-form">
<ActivateUserForm passwordHash={settings.passwordHash} />
<ActivateUserForm
passwordHash={settings.passwordHash}
passwordSettings={passwordSettings}
/>
</FormWrapper>
</>
)}

View File

@ -28,10 +28,13 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { GreetingContainer } from "@/components/GreetingContainer";
import PasswordChangeForm from "@/components/PasswordChangeForm";
import { getSettings } from "@/utils/actions";
import { getPortalPasswordSettings, getSettings } from "@/utils/actions";
async function Page() {
const settings = await getSettings();
const [settings, passwordSettings] = await Promise.all([
getSettings(),
getPortalPasswordSettings(),
]);
return (
<div className="content-center">
@ -39,7 +42,10 @@ async function Page() {
<>
<GreetingContainer greetingSettings={settings?.greetingSettings} />
<FormWrapper id="password-change-form">
<PasswordChangeForm passwordHash={settings.passwordHash} />
<PasswordChangeForm
passwordHash={settings.passwordHash}
passwordSettings={passwordSettings}
/>
</FormWrapper>
</>
)}

View File

@ -48,9 +48,11 @@ async function Page({ searchParams }: TfaActivationProps) {
const confirmKey = getStringFromSearchParams(searchParams);
const uid = searchParams.uid;
const res = await getTfaSecretKeyAndQR(confirmKey);
const settings = await getSettings();
const user = await getUserFromConfirm(uid, confirmKey);
const [res, settings, user] = await Promise.all([
getTfaSecretKeyAndQR(confirmKey),
getSettings(),
getUserFromConfirm(uid, confirmKey),
]);
return (
<div className="content-center">

View File

@ -39,8 +39,10 @@ async function Page({ searchParams }: TfaAuthProps) {
const confirmKey = getStringFromSearchParams(searchParams);
const uid = searchParams.uid;
const settings = await getSettings();
const user = await getUserFromConfirm(uid, confirmKey);
const [settings, user] = await Promise.all([
getSettings(),
getUserFromConfirm(uid, confirmKey),
]);
return (
<div className="content-center">

View File

@ -31,7 +31,13 @@ import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import CreateUserForm from "@/components/CreateUserForm";
import { GreetingCreateUserContainer } from "@/components/GreetingContainer";
import { getStringFromSearchParams } from "@/utils";
import { getSettings, getUserFromConfirm } from "@/utils/actions";
import {
getCapabilities,
getPortalPasswordSettings,
getSettings,
getThirdPartyProviders,
getUserFromConfirm,
} from "@/utils/actions";
import LanguageComboboxWrapper from "@/components/LanguageCombobox";
type LinkInviteProps = {
@ -47,10 +53,14 @@ async function Page({ searchParams, params }: LinkInviteProps) {
const uid = searchParams.uid;
const confirmKey = getStringFromSearchParams(searchParams);
const [settings, user] = await Promise.all([
getSettings(),
getUserFromConfirm(uid, confirmKey),
]);
const [settings, user, thirdParty, capabilities, passwordSettings] =
await Promise.all([
getSettings(),
getUserFromConfirm(uid, confirmKey),
getThirdPartyProviders(),
getCapabilities(),
getPortalPasswordSettings(),
]);
return (
<>
@ -69,6 +79,9 @@ async function Page({ searchParams, params }: LinkInviteProps) {
passwordHash={settings.passwordHash}
firstName={user?.firstName}
lastName={user?.lastName}
passwordSettings={passwordSettings}
capabilities={capabilities}
thirdPartyProviders={thirdParty}
/>
</FormWrapper>
</>