is there a way to add a custom name in login default values or we need custom component
import { AuthPage } from "@refinedev/mui";
import { CustomLogo } from "./CustomLogo";
export const Login = () => {
return (
<AuthPage
type="login"
title={<CustomLogo />}
registerLink={false}
forgotPasswordLink={false}
formProps={{
defaultValues: { UserName: "", password: "" },
}}
/>
);
};
i tried this but still i getting the authProvider that email,password --> theres is one userName and its undefined values
3 Replies
Hi @vinoth. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To customize the default values in the login form, you need to ensure that the
authProvider
is set up to handle the custom field names you are using. In your case, you are using UserName
instead of email
.
Here's how you can modify your authProvider
to handle the UserName
field:
And here is your Login
component with the AuthPage
:
Make sure that the authProvider
is correctly imported and used in your application. This setup should allow you to use UserName
as a default value in the login form.
For more details, you can refer to the authentication documentation (https://refine.dev/docs/authentication/auth-provider/#login) and the AuthPage component documentation (https://refine.dev/docs/ui-integrations/material-ui/components/auth-page/#login).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1270329411844968520> kapa.ai is still learning and improving, please let us know how it did by reacting below
adverse-sapphireOP•5mo ago
everything works but i have received in the UserName Empty but instead i received it from email