graph-interface-desktop-provider
Advanced tools
Comparing version 0.1.1 to 0.1.2
12
index.js
@@ -46,4 +46,5 @@ const fs = require('fs'); | ||
const response = await new Promise((resolve, reject) => { | ||
let server; | ||
try { | ||
const server = http.createServer(async (req, res) => { | ||
server = http.createServer(async (req, res) => { | ||
if (req.url === '/favicon.ico') { | ||
@@ -63,6 +64,6 @@ res.writeHead(404); | ||
const client = new Client({ | ||
clientId: credentials.clientId, | ||
clientSecret: credentials.clientSecret, | ||
authorizationUri: `https://login.microsoftonline.com/${credentials.tenantId}/oauth2/v2.0/authorize`, | ||
accessTokenUri: `https://login.microsoftonline.com/${credentials.tenantId}/oauth2/v2.0/token`, | ||
clientId: credentials.clientId || credentials.client_id || credentials['client-id'], | ||
clientSecret: credentials.clientSecret || credentials.client_secret || credentials['client-secret'], | ||
authorizationUri: `https://login.microsoftonline.com/${credentials.tenantId || credentials.tenant_id || credentials['tenant-id']}/oauth2/v2.0/authorize`, | ||
accessTokenUri: `https://login.microsoftonline.com/${credentials.tenantId || credentials.tenant_id || credentials['tenant-id']}/oauth2/v2.0/token`, | ||
redirectUri: 'http://localhost:9090', | ||
@@ -74,2 +75,3 @@ scopes: ['https://graph.microsoft.com/.default', 'offline_access'] | ||
} catch (err) { | ||
if(server) server.close(); | ||
return reject(err); | ||
@@ -76,0 +78,0 @@ } |
{ | ||
"name": "graph-interface-desktop-provider", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Authentication Providers for delegated access on Graph-Interface", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
11853
13
216