better validation and error reporting for auth workflow
small changes