I have a route setup for this:
// Program.cs
// https://www.example.com/{clientID}/dashboard/index?id=
app.MapControllerRoute(
name: "Portal",
pattern: "{clientID}/{controller=Dashboard}/{action=Index}/{id?}");
I will always pull data based on the logged in user, not the URL. I want to prevent someone from logging in as client1 and changing the url to client2 without an unauthorized message.
Or better yet, prevent client1 from logging in from client2's portal. Currently, the URL is cosmetic only.
Even a way to change the URL back to the logged in client after each action would be sufficient. I'm looking for a way to do that globally instead of adding code after every action.
Is that possible? Thanks!