How to allow user to logout after 403 error

I have a set of apps running in containers which are working well so far. However, I’m directing the user to the app directly using NGINX so they never see the portal.

app1.example.com goes to /app/app1
app2.example.com goes to /app/app2

If the user user who usually uses app1 enters the credentials to app2 they get a 403 Forbidden error. This probably only happens for internal users who work on multiple projects. The 403 Forbidden error doesn’t have a signout button or any recourse. Once you have logged into the app incorrectly that computer can’t try again with a different user unless you clear the cookies and cache. This isn’t ideal if maybe you’re travelling and need your coworker to just log in and get the presentation done.

How can I make it so that 403 error has a logout button?