documentation/tutorial/ui-libraries/authentication/ant-design/react-router/index.md
import { Sandpack, UseAuthPageInLogin } from "./sandpack.tsx";
<Sandpack>Now our application is ready to use with layouts, views and notifications. Only thing left unstyled is the /login page. Refine provides <AuthPage /> components which works with Refine's auth hooks and uses the UI elements from the Ant Design.
<AuthPage /> component supports multiple views such as:
login which renders a login form with links to the other auth pages such as forgot password and sign up and works with the useLogin hook.register which renders a register form and works with the useRegister hook.forgotPassword which renders a forgot password form and works with the useForgotPassword hook.updatePassword which renders a update password form and works with the useUpdatePassword hook.<AuthPage /> ComponentNow let's update our <Login /> component to use the <AuthPage /> from @refinedev/antd package. This component will provide a consistent look and feel with the rest of the application.
Update your src/pages/login.tsx file by adding the following lines:
import React from "react";
import { AuthPage } from "@refinedev/antd";
export const Login = () => {
return (
<AuthPage
type="login"
formProps={{
initialValues: {
email: "demo@demo.com",
password: "demodemo",
},
}}
/>
);
};
Now logout and try to login again. You will see the new login page with the Ant Design components.
In this unit, we've covered the following topics:
<AuthPage /> components.In the next unit, we'll learn about the additional tools and packages that Refine provides to make the developer experience even better.
</Sandpack>