finished the authentication logic cheers!