menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Divjoy

The ⚛️ React codebase generator.

Channels
Team

Create authenticated pages with a single click 🔐

June 9, 2020 at 10:16pm

Create authenticated pages with a single click 🔐

June 9, 2020 at 10:16pm (Edited 2 years ago)
I just rolled out an update that makes it super easy to create pages that require authentication. In the Divjoy editor you can now select any page and click the "Require Authentication" checkbox.
Screen Shot 2020-06-09 at 2.46.41 PM.png
The page will then:
  • Show a loading icon if waiting on auth status
  • Redirect to login if not signed in
  • Display the page if signed in
Under the hood this is powered by a requireAuth Higher Order Component that you can continue to use after exporting your code. Simply wrap your component when exporting it and you're good to go.
Screen Shot 2020-06-09 at 3.19.44 PM.png
No messages yet