Coder Social home page Coder Social logo

totaljs-jwt-session's Introduction

totaljs-jwt-session

Example build application with Total.js using JWT and Session.

Usage

  • Download or clone this repository
  • Go to extracted directory then $ npm install
  • Run $ node debug.js
  • Go to 127.0.0.1:8000
  • Done

User Authentication

  • Register user at 127.0.0.1:8000/register
  • Then you are able to login at 127.0.0.1:8000/login

How JWT and Session Works

  • 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 in microservices architecture, you have to use redis and modify the session_api middleware by yourself.

Note:

  • This example is using Argon Dashboard Pro template which is you can buy at here.
  • If you going to production, You need to regenerate the jwt_private.key and jwt_public.key at here.

totaljs-jwt-session's People

Contributors

aalfiann avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.