Adding token-based authentication for app

Great job if you have made it this far, as you have not only added authentication and registration to your app but also created a web app that can be used by multiple users to create Shopping Lists and items that only they can view and edit. The way users stay authenticated on the web is due to sessions, and they do not need to enter their password for every request they make. This is possible due to browsers storing the session token in the cookie of the browser, which gets sent to the server every time a request is made. Using the token in the cookie, it is able to decipher the user making the request by looking it up in the in-memory sessions dictionary. So this works seamlessly in the browser, ...

Get Hands-On Full-Stack Development with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.