Load original URL after logging in

Started by Kolya, March 07, 2021, 05:45:28 PM

Previous topic - Next topic

Kolya

If users attempt to open this URL to their own profile view [https://www.simplemachines.org/community/index.php?action=profile] and they are blocked because they are not logged in, they get a misleading error message:
"The user whose profile you are trying to view does not exist."

If they then log in, they're pointed at the home page, instead of the URL they were trying to view. Pretty bad UX.

I fixed the error message ("Account not recognized. Try logging in first if you haven't yet.") but I would like to know how I can load the original URL after logging in.
Is there a configuration or a mod that deals with this?


shawnb61

I think its the other way around...

If using a proper profile url (with the ;u=##### at the end), it works perfectly.

If you're not logged on, you are brought to a logon form & told you need to login first.  Once you logon, you're brought to the originally requested url.

If you're not seeing that behavior, either your url was incomplete, or, you have a mod disrupting that behavior.
A question worth asking is born in experience & driven by necessity. - Fripp

Kindred

Well, Shawn, the action=profile withno username defaults to the logged in user's profile... so, it would generate an error.  The error is actuality correct, however, since the userid=null does not exist.  So, its not bad UX either.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kolya

https://www.simplemachines.org/community/index.php?action=profile is the only way I know to point everyone at their own profile.
If you think this was wrong, is there another way to do that?

Use case:
Password managers (like in Google Chrome browser) will try to help you change your password for websites (eg when your password was found in a data breach). In order to help you change the password, the manager links you to  https://www.example.com/.well-known/change-password (see: https://en.wikipedia.org/wiki/List_of_/.well-known/_services_offered_by_webservers).

I have created a redirect at that address that directs the user to the page where they can change their password, which is in their profile. I have no way of knowing their user ID at that point.
How can I link them to the correct page to change their password, if they had to log in first?

Kindred

You can only change your password after logging in.

You can trigger the lost password function to get you a temp login, but then must actually login to permanently change it
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kolya

Quote from: Kindred on March 08, 2021, 07:44:58 AM
You can only change your password after logging in.

I understand that. But after logging in the user is directed to the home page, instead of the profile page they were originally trying to view.

The lost password function is good but doesn't fit the use case here.

Advertisement: