deadbolt-client
v1.0.7
Published
Client for Deadbolt
Downloads
2
Readme
Deadbolt Client
Client for the deadbolt user service.
Usage example
import { DeadboltClient } from 'deadbolt-client';
import { DeadboltUser, NewUserData } from './Users/User';
const client = new DeadboltClient({ endpoint: 'http://deadbolt:3000' });
const data: NewUserData = {
email: '[email protected]',
username: 'testo',
password: 'shinyshoesfor5sheckles',
};
//Add a user
client.addUser(data).then(user => {
console.log("User created!", user.uuid);
});
//Login
// Note that Identifier can be uuid, email or username.
const identifier = '[email protected]';
const password = 'shinyshoesfor5sheckles';
client.login({ identifier, password }).then(result => {
console.log("Login ok?: ", result.success);
console.log("User object", result.user);
console.log("Session token", result.user.session.token);
});
Todo
[ ] Most of the documentation [ ] Setup automated testing [ ] Publish on npm [ ] Link to specific version of Deadbolt (current 2.1.1) [ ] Redo deadbolt :see-no-evil: