function for user auth beginnings