Example build application with Total.js using JWT and Session.
- Download or clone this repository
- Go to extracted directory then
$ npm install
- Run
$ node debug.js
- Go to
127.0.0.1:8000
- Done
- Register user at
127.0.0.1:8000/register
- Then you are able to login at
127.0.0.1:8000/login
- JWT and Session is authenticated from middleware.
- Generated JWT token will be expired after
30 days
. - JWT session will expire automatically if user have no any activity (idle) within
30 minutes
. - Page session will expire automatically if user have no any activity (idle) within
10 minutes
. - JWT and Page session will automatically extend the expires time if user have any activity.
- When User logout, JWT session and Page session will be expired but will not make expire the Generated JWT token (reusable for
30 days
). - This example is for
monolitic architecture
, If you are inmicroservices architecture
, you have to useredis
and modify thesession_api
middleware by yourself.
Note: