Best practices for client-side authentication via Backbone.js AJAX.
The app demos the following:
- CSRF headers in authentication requests to prevent forgery
- Auth state persistence through signed cookies
- Global (singleton) session model whose state changes can be listened to
- Client-side validations through ParsleyJS
- Salt/hashing of passwords for back-end storage
Uses a persistent global Backbone.js SessionModel to manage state. Views and other models all can:
- subscribe to changes in session state
- extract current user data
- trigger auth events (login, logout, etc)
A lightweight, single-file Express.js server and SQLLite3 db. Responds to API routes, as well as initial index.html page render to plant the session CSRF token.
git clone https://github.com/marshall-kapfudza/meet-up-event-planner.git
cd meet-up-event-planner
npm install
node server.js
Then visit http://localhost:3000 in a browser.
Please fork and submit a pull request with adequate details.
The MIT License (MIT)