improve error handling on direct browser access to redirect uri