handle unauthorized errors

This should probably be abstracted out instead of relying on implementations handling this