teams-dev-samples
teams-dev-samples copied to clipboard
Add logout to tab-aad-msal2
Sample
tab-aad-msal2
Author(s)
@BobGerman
Suggestion
Could we have a logout button on this app? I'm not quite sure how that flow should work within teams with msal2?
Cheers, Rob
Are you willing to help?
No
Please using this method.
logoutPopup or logoutRedirect up to your context
logout() {
const username = this.getUsername()
const account = this.msalClient.getAccountByUsername(username)
if (!account) {
return false
}
try {
this.msalClient.logoutPopup({
account,
postLogoutRedirectUri: postLogoutRedirectUri,
mainWindowRedirectUri: postLogoutRedirectUri,
popupWindowAttributes: {
popupSize: {
height: 535,
width: 600
},
}
});
}
catch (err) { console.log(err); }
}