Fixed authentication bug in setup mail.
Setup mail wasnt reinitialize the authentication since
username was saved in the history. Decoupled these two into different
conditions.