In this episode, we're shifting our focus to what happens after a customer checks out. Up to this point, checkout has been a bit of a dead end—once someone fills in their details, nothing really happens. So, now we're going to fix that and build out the order confirmation page that everyone expects after hitting the pay button.
We walk through handling both guest and signed-in users. If someone checks out while signed in, we want to redirect them to their "orders" page (even though we'll be building that out more fully soon). If they're checking out as a guest, we'll send them to a simple confirmation page showing their order number (for now, just the ID), and give them an option to create an account right there. The cool part: once they register, next episode we're going to hook up any orders made with their email address, so their past guest orders move under their shiny new account automatically.
In practical terms, you'll see how to make a new controller and view for the confirmation page (passing in the order by UUID for a bit of privacy), set up the routes, and properly redirect users depending on their authentication state. We wrap up by testing both guest and logged-in checkouts, and set the stage for linking up orders with accounts in the next episode.