Manage the user authentication.
loggedIn: Boolean , true if the user is logged in
Manage the user authentication.
Parameters
api: ApiHelper, ApiHelper instance
Log the user in
Parameters
username: String, Log the user in
password: String, Log the user in
callback: function, Called with a boolean (true = auth success)
Log the user out
Parameters
callback: function, Called when the user is logged out (false
is passed in parameter if an error occur)
Save the user in the localStorage
Parameters
user: object, User object
Remove the user from the localStorage
Check if the token can authenticate the user
Parameters
callback: function, A boolean is passed (true = loggedIn)