diff --git a/src/app/+login-page/login-page.component.html b/src/app/+login-page/login-page.component.html
index 6dcb11fbb0..84059877f4 100644
--- a/src/app/+login-page/login-page.component.html
+++ b/src/app/+login-page/login-page.component.html
@@ -3,7 +3,8 @@
{{"login.form.header" | translate}}
-
+
diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.html b/src/app/shared/auth-nav-menu/auth-nav-menu.component.html
index b560283ad5..4df07880d8 100644
--- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.html
+++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.html
@@ -3,7 +3,8 @@
diff --git a/src/app/shared/log-in/log-in.component.spec.ts b/src/app/shared/log-in/log-in.component.spec.ts
index 43004b79c7..8ad423629d 100644
--- a/src/app/shared/log-in/log-in.component.spec.ts
+++ b/src/app/shared/log-in/log-in.component.spec.ts
@@ -58,8 +58,7 @@ describe('LogInComponent', () => {
{provide: AuthService, useClass: AuthServiceStub},
{provide: APP_BASE_HREF, useValue: '/'},
{provide: Router, useClass: RouterStub},
- {provide: RouteService, useValue: routeServiceStub },
- {provide: HostWindowService, useValue: new HostWindowServiceStub(900) }
+ {provide: RouteService, useValue: routeServiceStub }
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
@@ -151,6 +150,8 @@ describe('LogInComponent', () => {
const authService: AuthService = TestBed.get(AuthService);
spyOn(authService, 'setRedirectUrl');
+ component.isStandalonePage = false;
+
fixture.detectChanges();
expect(authService.setRedirectUrl).not.toHaveBeenCalledWith();
@@ -193,8 +194,7 @@ describe('LogInComponent on small screen', () => {
{provide: AuthService, useClass: AuthServiceStub},
{provide: APP_BASE_HREF, useValue: '/'},
{provide: Router, useClass: RouterStub},
- {provide: RouteService, useValue: routeServiceStub },
- {provide: HostWindowService, useValue: new HostWindowServiceStub(300) }
+ {provide: RouteService, useValue: routeServiceStub }
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
@@ -230,6 +230,7 @@ describe('LogInComponent on small screen', () => {
it('should set the redirect url on init', () => {
const authService: AuthService = TestBed.get(AuthService);
spyOn(authService, 'setRedirectUrl');
+ component.isStandalonePage = true;
fixture.detectChanges();
// set FormControl values
component.form.controls.email.setValue('user');
diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts
index 5097b2a0c7..3a4ff151bf 100644
--- a/src/app/shared/log-in/log-in.component.ts
+++ b/src/app/shared/log-in/log-in.component.ts
@@ -1,5 +1,5 @@
import {filter, map, pairwise, take, takeUntil, takeWhile, tap} from 'rxjs/operators';
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { select, Store } from '@ngrx/store';
@@ -86,13 +86,14 @@ export class LogInComponent implements OnDestroy, OnInit {
private redirectUrl = LOGIN_ROUTE;
+ @Input() isStandalonePage: boolean;
+
/**
* @constructor
* @param {AuthService} authService
* @param {FormBuilder} formBuilder
* @param {RouteService} routeService
* @param {Router} router
- * @param {HostWindowService} windowService
* @param {Store} store
*/
constructor(
@@ -100,7 +101,6 @@ export class LogInComponent implements OnDestroy, OnInit {
private formBuilder: FormBuilder,
private routeService: RouteService,
private router: Router,
- private windowService: HostWindowService,
private store: Store
) {
}
@@ -114,17 +114,14 @@ export class LogInComponent implements OnDestroy, OnInit {
this.isAuthenticated = this.store.pipe(select(isAuthenticated));
// for mobile login, set the redirect url to the previous route
- this.windowService.isXs().pipe(take(1))
- .subscribe((isMobile) => {
- if (isMobile) {
- this.routeService.getHistory().pipe(
- take(1)
- ).subscribe((history) => {
- const previousIndex = history.length - 2;
- this.setRedirectUrl(history[previousIndex]);
- });
- }
+ if (this.isStandalonePage) {
+ this.routeService.getHistory().pipe(
+ take(1)
+ ).subscribe((history) => {
+ const previousIndex = history.length - 2;
+ this.setRedirectUrl(history[previousIndex]);
});
+ }
// set formGroup
this.form = this.formBuilder.group({