set authtokenstate correctly while authenticatin