ctx.path.startswith('/callback/') - do the checks you want, then redirect them to your desired error page (gotta return a api error, so i created a new apiError then overwrote the status and status code to 302 (for redirect) then set the Location header to what i wanted the redirect to go to!