new code for auth