Accessing protected content
Since your model can now be authenticated by both password and session, you're ready to separate routes into public and protected content. A clear separation between public and protected content is needed so you don't accidentally expose protected content to unauthenticated users in public routes. The route grouping technique in Vapor is useful in organizing public and protected routes into distinct route groups. You can apply an authentication requirement to the route group with routes of protected content.
Any user who wishes to get access to the protected content must first provide login credentials to your Vapor application, and then the application will authenticate the submitted user login and password information ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access