Fix bug with wrong status code when authorize.