sleepless-sessions
v1.9.1
Published
## API
Downloads
10
Readme
sessions
API
// Register a new user account
register( email, user_id, password, done, fail )
// Delete a user account
unregister( uid_or_email, password, done, fail )
// Authenticate/login a new user account
// Returns a session object if successful
authenticate( uid_or_email, password, done, fail )
// Get sanitized user object given a user_id or email
get_user( uid_or_email, done, fail )
// Get sanitized session object for an sid or null if sid is invalid
get_session( sid, done, fail ) // returns { sid, expires, user: { user_id, email } }
// Reset the timeout for an active session
freshen_session( sid, done, fail )
// Clear/delete a session
end_session( sid, done, fail )
// Generates a password reset code for a user and returns it
reset_password_code( uid_or_email, done, fail )
// Set a new password for a user.
reset_password( reset_code, new_password, done, fail )
// Dispose of the session API object
destroy()