-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
returnUrl in LoginContent #16
Comments
Yes, it's possible to use the returnUrl prop in the LoginContent component to redirect the user to a specific page after they log in. Here's an example of how you can use it: const MyLoginPage = () => { return ( When the user logs in, they will be redirected to the URL specified in the returnUrl prop. If the returnUrl prop is not specified or is set to an empty string, the user will be redirected to the home page of the website. |
Yo
I don't know why am I receiving these mails please remove me from your
mailing list
…On Mon, Feb 27, 2023, 14:55 Charz Lwebz ***@***.***> wrote:
Yes, it's possible to use the returnUrl prop in the LoginContent component
to redirect the user to a specific page after they log in. Here's an
example of how you can use it:
`import LoginContent from 'vtex.login/LoginContent';
const MyLoginPage = () => {
const returnUrl = encodeURIComponent('https://example.com/my-account');
return (
<LoginContent
profile={profile}
defaultOption={1}
returnUrl={returnUrl}
emailAndPasswordTitle={Entrar com e-mail e senha:}
optionsTitle={Use uma das opções abaixo:}
accessCodeTitle="Receber código de acesso por e-mail"
emailPlaceholder="Digite seu e-mail"
passwordPlaceholder="Digite sua senha"
accessCodePlaceholder="Digite seu código"
isInitialScreenOptionOnly={false}
showPasswordVerificationIntoTooltip={true}
/>
);
};
`
In this example, the returnUrl prop is set to
https://example.com/my-account, which is the URL that the user will be
redirected to after they log in. Make sure to encode the URL using the
encodeURIComponent function, as shown in the example.
When the user logs in, they will be redirected to the URL specified in the
returnUrl prop. If the returnUrl prop is not specified or is set to an
empty string, the user will be redirected to the home page of the website.
—
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR3O43GFFMTATQZYES2547LWZSP4RANCNFSM5YEY4I3A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@charzlwebz256 But, how you imported vtex.login: "2.x" in you manifest? I got this error. |
Hi, not work for me, did it work for anyone |
Hi guys! How it's going?
How using returnUrl in LoginContent? This is possible?
The login is working. But returnUrl after login not.
Custom app:
The text was updated successfully, but these errors were encountered: