Exemple #1
0
 /**
  * Authorise application for dev environment
  * This creates a test login for development purpose
  */
 async authoriseMock() {
   try {
     this[_app] = await initializeApp(this[_appInfo].info, null, { libPath: this[_libPath] });
     await this.app.auth.loginForTest(this[_appInfo].permissions);
     return;
   } catch (err) {
     throw err;
   }
 }
Exemple #2
0
 /**
  * Send Authorisation request to Authenticator.
  * - Initialise the application object
  * - Generate Auth request URI
  * - Send URI to Authenticator
  */
 async requestAuth() {
   try {
     const app = await initializeApp(this[_appInfo].info, null, { libPath: this[_libPath] });
     const resp = await app.auth.genAuthUri(this[_appInfo].permissions, this[_appInfo].opts);
     // commented out until system_uri open issue is solved for osx
     // await app.auth.openUri(resp.uri);
     openExternal(resp.uri);
     return;
   } catch (err) {
     throw err;
   }
 }