authonice-mithril
v0.0.9
Published
authonice frontend for mithril
Downloads
5
Maintainers
Readme
authonice (mithril)
IN PROGRESS: not ready, yet
This is the authonice frontend for mithril.
authonice is a platform/language/framework agnostic ecosystem for web-app authentication, with lots of inspiration from satellizer.
It's designed to work with lots of backend languages, auth services, & frontend frameworks. It's goal is to make you super-happy because your sites are safe, easy to setup & maintain, and stylishly locked-down in your language/frameworks of choice.
If we don't have a module for the frontend-framework/backend-language/auth-service you want to support, ask us or contribute!
installation
You can install with bower, npm, download or just add script tags to your HTML.
webpack/browserify/etc
var authonice = require('authonice-mithril');
requirejs
define(['mithril','authonice-mithril'], function(m, authonice){
});
plain browser globals
<script src="https://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.30/mithril.min.js"></script>
<script src="https://rawgit.com/authonice/front-mithril/master/dist/authonice-mithril.min.js"></script>
usage
The API is très simple:
loggedIn()
- does the user have a token?login(email, password)
- trade credentials for a tokenlogout()
- forget tokenregister(email, password)
- save some login credentialsverify(token)
- prove that the user got an email (or read the console or whatever)user()
- get the current server-side userreq()
- a wrapper form.request
that ensures authentication & defaults toGET
For an in-depth example see demo-node-mithril