The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/root/MainLayout/PasswordChangeCheck.tsx

21 lines
694 B

import { useUser } from '@rocket.chat/ui-contexts';
import type { ReactElement, ReactNode } from 'react';
import { lazy } from 'react';
import TwoFactorAuthSetupCheck from './TwoFactorAuthSetupCheck';
const ResetPasswordPage = lazy(() =>
import('@rocket.chat/web-ui-registration').then(({ ResetPasswordPage }) => ({ default: ResetPasswordPage })),
);
const PasswordChangeCheck = ({ children }: { children: ReactNode }): ReactElement => {
const requirePasswordChange = useUser()?.requirePasswordChange === true;
if (requirePasswordChange) {
return <ResetPasswordPage />;
}
return <TwoFactorAuthSetupCheck>{children}</TwoFactorAuthSetupCheck>;
};
export default PasswordChangeCheck;