A user must be logged in before they can start making actions (uploading, annotating, etc).
There are two ways to login a user. One is with a username & password, and the other is with an authentication token.
To login a user with a username and password, you can use the
The username and password provided will be passed into your
verifyPassword function on the server. If the username and password are valid, the user will be logged in. If they are not, the promise will be rejected with an error.
You can also login a user using an authentication token via the
This function will pass the authentication token into your
getUserFromToken function on the server. If then token is valid, the user will be logged in, otherwise the promimse will be rejected with an error.