This question seems to be asking almost the same thing, but for some reason I can't get any of the answers to fully work in my situation.
I'm looking for a direct link I can put in a web app to navigate to the inbox of a specific gmail account, with the following use cases:
I would like a link to go to email@example.com (domain.com is a google workspace account).
If a user is logged into firstname.lastname@example.org and NOT into email@example.com, I'd like to go to the account login page for firstname.lastname@example.org
If the user is not logged in to any gmail services (such as incognito), I'd like the link to go to the account login page for email@example.com (this is similar to 2, but google treats these differently)
If a user is logged into firstname.lastname@example.org, I'd like them to go to the inbox directly.
I tried all the answers on the linked question, but I found they all failed case 2 for me. They would invariably simply go to my first logged in inbox (email@example.com) in my example.
I got further with this answer by setting the passive=false parameter, but while this did show me the login screen for case 2, it autofilled the information with firstname.lastname@example.org.
Is there a way to create a link that would follow these use cases for a gmail inbox? Or at least, is there a link that would simply bring me to the login page for email@example.com from all possible starting points?
The webapp will also probably use the gmail api, so if it's possible with that, that would also work as a solution (I haven't had a deep dive into it, but I didn't see anything off the top that would give me a link through the api)