This todo app showcases sign in functionality with the Descope Passport Strategy, Express, and React. This example can be used to help you implement the Descope strategy in your own projects.
This app is a JS app with a backend, with the UI executing in the browser while data management and persistence is handled by the server.
The login page uses Descope Flows to handle user authentication and create the JWT for the backend session validation. For demo purposes, the session and refresh tokens are kept in cookies and localstorage.
After signing in, the user can view, create, and edit todo items.
Note: to be secure, you must configure Descope with your own custom domain and keep the refresh token in an http-only cookie.
Running this sample app is super easy. Just go through the following steps:
- Run the following command to install the necessary packages and the
Descope Strategy
from npm.
npm install
- Run this command to start the todo application
npm run start
This app conforms with the TodoMVC specification,
with two notable exceptions. First, it adds a user login and registration
system to the app via flows. Second, it persists data remotely rather than in
localStorage
. Remote storage is accessed via an API that conforms with
Todo-Backend, which is also extended to support
authentication.
Based on example created by Jared Hanson