How do I use history.push("/") conditionitionaly depending on the page you are? - react-router-dom

I am using history.push("/") on the login page when login is successful. This is when I directly go to login page. I also want to redirect to login page on the checkout page is the user in not logged in. Then after that I want the user to go on next page not on homepage ("/"). How do I can do this?

Related

Azure AD B2C - Password Reset custom page layout HTML after emailed code

I've personalized a user flow to use a HTML page and it works very well. I've also added it to the login user flow.
My problem is when the user goes to the reset password flow (that is right), send the code to his email and click "Continue". The page after, where the user inputs the new password, doesn't have the HTML that I've personalized and I don't find where I can do set it.
Thanks for any help!
So, I've found it!
On Page Layout there are multiple Layouts associated with the User Flow.
I just added the custom page to the Layout Change password page and that's it.

shopware login not work so what is actual issuse?

I have setup shopware on a localhost server.
I have created a customer for login but when try to login with created customer no change in the page. It means only the login and register page show, Redirect to other pages are not working.
If I can try to open profile page or addresses page, page not opens only show login or register.
So What is the problem?? Additional setting required for login?
In the Top navigation account tab Login name show.
https://github.com/shopware/shopware/blob/5.4/engine/Shopware/Configs/Default.php#L207
You should check if this fits your server configuration and database or change it via config.php. Login issues are often caused by timezone differences between php and database.

Liferay Custom landing page or last path?

User A ----> has "XYZ" role and has "ABC" as home site User B ---->
has "PQR" role and has "DEF" as home site
Whenever user A logs in I need to redirect him to site "ABC" rather than default guest site.
Whenever user B logs in I need to redirect him to site "DEF" rather than default guest site.
Through hook I have achieved this
hook property:
login.events.post=com.mytest.portal.events.MyLoginPostAction
And then in MyLoginPostAction I have checked the user role and then redirected him to corresponding site.
Now, say user A has subscribed to the blog on any of the site. He receives an emaial containing link to that Blog.
User A is logged out and then he tries to reach that Blog with direct link. Since user A is not logged in, he is redirected to login page.
On log in he is redirected to site "ABC" rather than going to that Blog. This is due to I am redirecting User to home site.
So how can I achieve this scenarioes i.e when user try to access that Blog page when not logged in then on log in he should go to that blog page and when user just try to log in to portal then he should redirect to home site.
You can get lastpath object in your action class by
request.getSession().getAttribute("LAST_PATH")
And based on path value from lastpath object, you can determine where to redirect.
By necessary login by direct link, Liferay set the forward path as url parameter. May be you can read the redirect parameter from request and decide to forward to specific page or not.

How to configure multiple login pages for Liferay

Based on discussion at http://www.liferay.com/community/forums/-/message_boards/message/10335161 there is a way to configure URL to redirect user in case of expired session:
auth.login.url=/url/to/login
what if I need different URLs based on URL I want to access? E.g. I have /test/login1, /test/login2, /test/login2 pages with login forms.
If session expires and user tries to access page with URL /page/room1
he should be redirected to /test/login1
If session expires and user tries to access page with URL /page/room2
he should be redirected to /test/login2
If session expires and user tries to access page with URL /page/room2
he should be redirected to /test/login2
and so on..
is there a way to do this using Liferay? I am pretty sure that such feature may require hook to be developed so the real question is how to get original URL user wanted to access once session has expired?
You could get lastpath by
LastPath lastPath = (LastPath)request.getAttribute(WebKeys.LAST_PATH);
and from this, you can get information about last accessed url.
And by writing custom login post action using hook, you can redirect user to particular page based on lastpath.
HTH

How to dispatch SharePoint user to different landing page per their user group immediately after login

I got a requirement to dispatch users to different landing page per their user group immediately after login, it seems SharePoint does not supply an API regarding login event, so I implemented a web part and added it to homepage to handle the dispatch, this would work perfect util users logout and login, SharePoint has a history where users were in their last login, to be precise, a parameter in url named Source to handle the redirect after login, so users will on longer go to their customized landing page.
I searched a lot and found someone doing this with custom login from, this is way too complex and client won't let me touch their Active Directory.
I'm at my wit's end to know what to do, can someone shed some light on this, any help or advise is deeply appreciated
Why don't you use a delegate control in the masterpage, that checks a value in the session if you entered through the landing page. On the landing page you add the value to the session specifying that this user has entered through the landing page.

Resources