new(core.gbapp): #387 adding /setupSecurity multiple tokens.

This commit is contained in:
Rodrigo Rodriguez 2023-11-17 15:24:05 -03:00
parent db21ad6574
commit 863591741d

View file

@ -513,7 +513,7 @@ export class GBMinService {
tokenName ? host : min.instance.authenticatorAuthorityHostUrl, tokenName ? host : min.instance.authenticatorAuthorityHostUrl,
tokenName ? tenant : min.instance.authenticatorTenant) tokenName ? tenant : min.instance.authenticatorTenant)
); );
const resource = 'https://graph.microsoft.com'; const resource = tokenName ? '' : 'https://graph.microsoft.com';
// Calls MSFT to get token. // Calls MSFT to get token.
@ -525,9 +525,12 @@ export class GBMinService {
tokenName ? clientSecret : instance.marketplacePassword, tokenName ? clientSecret : instance.marketplacePassword,
async (err, token) => { async (err, token) => {
if (err) { if (err) {
const msg = `handleOAuthTokenRequests: Error acquiring token: ${err}`; const msg = `handleOAuthTokenRequests: Error acquiring token: ${err}`;
GBLog.error(msg); GBLog.error(msg);
res.send(msg); res.send(msg);
} else { } else {
// Saves token to the database. // Saves token to the database.