Example app: multi-user local JWT authentication

:wave: - I’ve shipped an example repo of a JWT local auth based on Redwood 1.0: GitHub - orta/redwood-jwt-2phase-auth: An example of using multi-user JWT authentication with Redwood"

The example shows a short + long JWT style auth which works with a netflix-style account system (aka one Account which can have many Users.) Handles switching accounts, logging in via email or username. It TypeScript-ifies and builds on the work from 3nvy in “Local JWT Auth Implementation”.

This code can handle auth via cookies, headers (bearer) and embedded JSON requests which is enough to handle the default Redwood setup and external clients like native apps.

It’s pretty barebones as a mostly direct port from WIP codebase, but the systems are in place now and have been running for a few weeks. If you want to use this, first read this which is a good pitch against not doing it this way - but note that even the biggest players in the space have recently had data leakages.

5 Likes