Authentication

Authentication

The Authentication Model handles login and logout and authentication locally or remotely. *

Constructor

new Authentication()

Source:
Tutorials:
  • Tutorial: tests/authentication/AuthenticationTest.js
Properties:
Name Type Description
user User The user is a User object (User, Bot or Consultant) which is logged in and viewing the app with that user's perspective. To check whether some data is public/viewable/editable the app.user should be used to verify the permissions. If no user is logged in a special user "public" is logged in and used to calculate permissions.

Extends

Members

login

Source:
Contacts local or remote server to verify the username and password provided in the user object. Upon success, calls the callback with the user.

syncUserWithServer

Source:
This function uses the quick authentication view to get the user's password and authenticate them. The authenticate process brings down the user from the server, and also gets their sesson token from couchdb before calling the callback. If there is no quick authentication view it takes them either to the user page (in the ChromeApp) or the public user page (in a couchapp) where they dont have to have a corpus token to see the data, and log in

user

Source:
This function parses the server response and injects it into the authentication's user public and user private