code: function login(username, password) {
  	if (!cocoonSDK.CocoonAPI.checkAPIAccess()) {
  		return oAuth.tokenExchangePassword(username, password)
  		.then((result) => {
  			cocoonSDK.CocoonAPI.setupAPIAccess(result.access_token, result.refresh_token, result.expires_in);
  			return undefined;
  		})
  		.catch((error) => {
  			console.error("Login not successful.");
  			console.trace(error);
  			throw error;
  		});
  	} else {
  		return Promise.resolve();
  	}
  }
docs: ================== FUNCTIONS ================== \\ 
  Logs the user in if not already logged in.
  @param {string} username
  @param {string} password
  @return {Promise<void>}