注销并立即尝试重新登录时出现以下错误。只有关闭浏览器似乎才能解决该问题。所以我假设这是某种缓存问题,但我似乎无法找到解决方法。
这是我当前使用的登录代码:
async signIn() {
// console.log(this.appMSALObj)
var _this = this;
await this.appMSALObj.loginPopup(settings.loginRequest)
.then(function(response) {
//console.log("authService: login complete")
_this.selectAccount();
//console.log(_this.account)
_this.router.navigate(['/home'])
})
.catch(error => {
console.error(error);
});
}
它永远不会进入 selectAccount 函数。
msalConfig 设置为使用 localStorage,并且 storeAuthStateInCookie 标志为 false。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
回答有点晚了,但我会尝试一下。
根据docs 当第一个操作尚未完成而第二个操作被触发时,就会发生这种情况。例如:
在这种情况下,会发生
interaction_in_progress。 您可以通过等待以下操作轻松防止这种情况:在某些情况下,这并不能解决问题。 就我而言,缺少
<app-redirect></app-redirect>也可能导致此错误。它必须放在您的index.html中:值得注意的有趣的事情:如果您对
app-routing.module.ts中提到的每个路由强制登录,即使您不使用<app-redirect></app-redirect>,它仍然可以正常工作而不会出现错误