Hi @SergeiAfanasev,
Did you see this thread already?
Another developer has shared a workaround in this comment: When user is not logged in Jira is not redirecting to login page when app general page is accessed using direct link - #9 by moveworkforward
It would not help in every case, but it could help in the third case that you shared.
Thanks,
Caterina