Project

General

Profile

« Previous | Next » 

Revision 56966

[mergeResultLandingPages | Library]: Merging Trunk into branch 56883:56965

View differences:

userMini.component.ts
81 81
    @Input() logInUrl;
82 82
    @Input() logOutUrl;
83 83
    @Input() cookieDomain;
84
    public redirectUrl: string = "";
84
    @Input() redirectUrl: string;
85 85
    sub:any;
86 86

  
87 87
    constructor( private router: Router, private  route: ActivatedRoute, private location: Location) {}
......
99 99

  
100 100
    }
101 101
    ngOnDestroy(){
102
      this.sub.unsubscribe();
102
      if(this.sub) {
103
        this.sub.unsubscribe();
104
      }
103 105
    }
104 106

  
105 107
    initialize(){
106
      this.redirectUrl = this.location.path();
108
      if(!this.redirectUrl && location) {
109
        this.redirectUrl = location.pathname;
110
      }
107 111
      if(Session.isLoggedIn()){
108 112
          this.loggedIn = true;
109 113
          this.user = Session.getUser();
......
133 137
    }
134 138

  
135 139
    logIn(){
136
      Session.setReloadUrl(location.protocol +"//"+location.host, location.pathname, location.search);
137
      window.location.href = this.logInUrl
140
      Session.setReloadUrl(location.protocol +"//"+location.host, this.redirectUrl, location.search);
141
      window.location.href = this.logInUrl;
138 142
    }
139 143

  
140 144
    onClick(id: string) {

Also available in: Unified diff