Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diet-accounts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diet-accounts

Account Management

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Diet: Accounts (in development)

User account management is a general function that we reuse in every application. Accounts is a simple set of API's that you can use as a standard in all your apps.

With Accounts you can interact with user accounts without touching the backend unless you want to do something more.

Install

If you are using diet it's already installed.

npm install diet-accounts

Example Setup

// CREATE a new dietjs application
var app = new Application(options);

// SETUP account module
var account = app.accounts({
	table		 : 'users',	   // mysql table
	username      : 'username',	// username column in table
	password	  : 'password',	// password column in table
	select		: '*'	 	   // what to select if user authentication is successfull
});

API

You can interact with your Accounts trough these urls on your website: METHOD | URL | STATUS | --- | --- | --- | --- POST | /account/login | working POST | /account/logout | working POST | /account/update | beta POST | /account/changePassword | beta POST | /account/delete | beta POST | /account/signup | beta POST | /account/verify | beta GET | /account/recover/password | beta POST | /account/recover/password | beta

Default Response from the API's

If the call ends with success then:

{ success: true, errors: false }

If the call fails then:

{ success: false, errors:[Array of Errors] }

Customizing the API's

All account actions are accesible via the Accounts API but you can add custom middleware functions too.

// Custom Login
account.login(function(request, response, mysql){
	// do some custom stuff
	response.end();
	mysql.end();
});

// Custom Logout
account.logout(function(request, response, mysql){
	// do some custom stuff
	response.end();
	mysql.end();
});

Keywords

FAQs

Package last updated on 14 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc