added validations while refactoring login authentication and authroization