Tabs sign out lose previous back button

My app has a home screen and a Login button. When tap on this button, the user goes to login screen. So, if the user authenticated is true, then, redirect to tabs.TAB2.

[TAB1, TAB2, TAB3 (SignOut)]

The user can navigate between tabs, but, when tap on SignOut tab, if he was in TAB2, he will go back to the login screen and the back button it show. Otherwise, if the user was on TAB1 and want to SignOut, he will go back to the login screen, but, the back button disappear.

I think this occurs because login screen goes to tabs.TAB2.

Anyone can help me?

How did you implement the SignOut tab? Can you provide some code sections?