Now the AD password can be reset.

This commit is contained in:
Rodrigo Rodriguez 2018-09-16 18:17:28 -03:00
parent c03228dbbe
commit 7e6ab65a37
4 changed files with 316 additions and 305 deletions

View file

@ -128,8 +128,12 @@ export class AdminDialog extends IGBDialog {
await dc.endAll();
let service = new GBAdminService();
await service.saveValue("authenticatorToken", args.token)
await dc.context.sendActivity("Token has been updated.");
await dc.replace("/ask")
await dc.context.sendActivities([
{ type: 'typing' },
{ type: 'message', text: "Token has been updated." },
{ type: 'message', text: "Please, log out now from the administration work account on next screen." },
{ type: 'delay', value: 4000 },
])
}
]);

View file

@ -332,7 +332,12 @@ export class GBMinService {
// Otherwise, continue to the active dialog in the stack.
} else {
if (dc.activeDialog) {
await dc.continue()
} else {
await dc.begin("/answer", {query: context.activity.text})
}
}
// Processes events.
@ -369,7 +374,7 @@ export class GBMinService {
}
}
} catch (error) {
let msg = `Error in main activity: ${error}.`
let msg = `Error in main activity: ${error.message}.\n${error.stack}`
logger.error(msg)
}
})

View file

@ -71,7 +71,10 @@ class GBUIApp extends React.Component {
timestamp: new Date().toISOString(),
from: { id: "webUser", name: "You" }
})
.subscribe(this.send("success"));
.subscribe(() => {
window.userAgentApplication.logout();
console.log("updateToken done")
});
}, 400);
}
@ -145,21 +148,20 @@ class GBUIApp extends React.Component {
let userAgentApplication = new UserAgentApplication(
this.state.instanceClient.authenticatorClientID,
authority,
function (errorDesc, token, error, tokenType) {
userAgentApplication.acquireTokenSilent(graphScopes).then(function (accessToken) {
_this_.sendToken(accessToken);
}, function (error) {
function(errorDesc, token, error, tokenType) {
if (error) {
console.log(error);
})
}
}
);
window.userAgentApplication = userAgentApplication;
if (!userAgentApplication.isCallback(window.location.hash) && window.parent === window && !window.opener) {
var user = userAgentApplication.getUser();
if (user) {
userAgentApplication.acquireTokenSilent(graphScopes).then(function (accessToken) {
userAgentApplication.acquireTokenSilent(graphScopes).then(function(accessToken) {
_this_.sendToken(accessToken);
}, function (error) {
}, function(error) {
console.log(error);
})
}

View file

@ -183,7 +183,7 @@ export class AskDialog extends IGBDialog {
// Three forms of asking.
if (args.firstTime) {
if (args && args.firstTime) {
text = Messages[locale].ask_first_time;
} else if (args && args.isReturning) {
text = Messages[locale].anything_else;