LaunchFa.st comes with baked-in protected page(s) to help you prevent un-authenticated access to such pages. With the authentication methods such as Twitter OAuth 2.0, Google OAuth 2.0 and Credentials (email and password) built in with LaunchFa.st, such authenticated methods can be used by your users to get access to the protected pages in your application.
Here’s how easily you can create protected pages with LaunchFa.st:
- Create a file, say
protected.astro
with the following code:
- That’s it! The
getSession
in the LaunchFast Starter Kit takes care of decoding the session cookies and validating the user authentication status. If unauthorized, a 403 response is sent enforcing authentication based access to the content.
Worry not, with LaunchFa.st you get such a page protected.astro
built for you with goodies on top.