# Pastebin gv9I1vGE my $application = route { get -> 'character', $id { request-body -> %request { if %request { my $user = User.^load(uuid => %request); if $user { my $character = Character.^load($id); note "[{ DateTime.now }] Performing lookup on $id"; if $character { content 'application/json', $character.to-json; } else { not-found; } } else { forbidden; } } else { forbidden; } } } } class PFAPI::Authenticate does Cro::HTTP::Middleware::Request { method process(Supply $requests) { $requests.do: -> $req { with $req.body('auth') -> $uuid { my $user = User.^load(:$uuid); } } } }