Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
页面刷新后,Angular Azure广告保持登录状态_Angular_Azure - Fatal编程技术网

页面刷新后,Angular Azure广告保持登录状态

页面刷新后,Angular Azure广告保持登录状态,angular,azure,Angular,Azure,最近,我正在使用Azure AD身份验证创建一个Angular应用程序。但是,当成功地从Azure进行身份验证时,一旦我刷新页面,会话将结束。下面是login()方法的示例代码 是否有任何方法可以在页面刷新后保持我的登录会话?多谢各位 login() { this.msalService.loginPopup().subscribe((response: AuthenticationResult) => { this.msalService.instance.setAc

最近,我正在使用Azure AD身份验证创建一个Angular应用程序。但是,当成功地从Azure进行身份验证时,一旦我刷新页面,会话将结束。下面是login()方法的示例代码

是否有任何方法可以在页面刷新后保持我的登录会话?多谢各位

login() {
    this.msalService.loginPopup().subscribe((response: AuthenticationResult) => {
      this.msalService.instance.setActiveAccount(response.account)
      this.router.navigate(['/posts'])
    }, errResponse => {
      console.log(errResponse)
      this.router.navigate([''])
    })
  }