In OpenIdConnect getUser returns null , even after the receiving token

after successfully authenticated by the Identity Server return token and redirected app.ts but when I call getUser () in app.ts it will return null and also this code working properly in localhost.but when I try in server didn’t work.

  constructor(private openIdConnect: OpenIdConnect, private httpClient: HttpClient) {
    let mgr = this.openIdConnect.userManager;
    this.openIdConnect.userManager.getUser().then((user) => {
      if (user) {
        this.user = user;
        console.log(" This.User: "+this.user);
        console.log(" User: "+ user)      
        console.log(" logout ");

The Problem was the way I build the app to production.So earlier I used "au build --env prod " I changed it to “au build --env