test when rest.auth() returns error in endpoint handler