better login handling
error and authorization handling