[Trunk | Library]: Remove search params from when redirect url is custom.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58585 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-04 08:59:45 +00:00
parent 1aa854b72a
commit a793375b14
1 changed files with 3 additions and 1 deletions

View File

@ -169,6 +169,7 @@ export class UserMiniComponent implements OnInit, OnChanges {
@Input() logOutUrl;
@Input() cookieDomain;
@Input() redirectUrl: string;
search: string = '';
sub: any;
constructor(private router: Router, private route: ActivatedRoute, private location: Location) {
@ -202,6 +203,7 @@ export class UserMiniComponent implements OnInit, OnChanges {
initialize() {
if (!this.redirectUrl && typeof location !== 'undefined') {
this.redirectUrl = location.pathname;
this.search = location.search;
}
if (this.user) {
this.loggedIn = true;
@ -228,7 +230,7 @@ export class UserMiniComponent implements OnInit, OnChanges {
}
logIn() {
Session.setReloadUrl(location.protocol + "//" + location.host, this.redirectUrl, location.search);
Session.setReloadUrl(location.protocol + "//" + location.host, this.redirectUrl, this.search);
window.location.href = this.logInUrl;
}