diff --git a/src/app/shared/log-in/log-in.component.html b/src/app/shared/log-in/log-in.component.html
index ebcc29f914..bb392f5d90 100644
--- a/src/app/shared/log-in/log-in.component.html
+++ b/src/app/shared/log-in/log-in.component.html
@@ -1,5 +1,7 @@
+
+
diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts
index 344a36ae55..b4911c5b43 100644
--- a/src/app/shared/log-in/log-in.component.ts
+++ b/src/app/shared/log-in/log-in.component.ts
@@ -5,6 +5,8 @@ import { select, Store } from '@ngrx/store';
import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors';
import { CoreState } from '../../core/core.reducers';
import { InjectedAuthMethodModel } from './injectedAuthMethodModel/injectedAuthMethodModel';
+import { filter, takeWhile } from 'rxjs/operators';
+import { AuthService } from '../../core/auth/auth.service';
@Component({
selector: 'ds-log-in',
@@ -35,9 +37,17 @@ export class LogInComponent implements OnInit, OnDestroy {
* @type {boolean}
*/
public loading: Observable;
+
+ /**
+ * Component state.
+ * @type {boolean}
+ */
+ private alive = true;
+
private subscription: Subscription;
- constructor(private store: Store) {
+ constructor(private store: Store,
+ private authService: AuthService,) {
}
ngOnInit(): void {
@@ -56,10 +66,22 @@ export class LogInComponent implements OnInit, OnDestroy {
// set isAuthenticated
this.isAuthenticated = this.store.pipe(select(isAuthenticated));
+
+ // subscribe to success
+ this.store.pipe(
+ select(isAuthenticated),
+ takeWhile(() => this.alive),
+ filter((authenticated) => authenticated))
+ .subscribe(() => {
+ this.authService.redirectAfterLoginSuccess(this.isStandalonePage);
+ }
+ );
+
}
ngOnDestroy(): void {
this.subscription.unsubscribe();
+ this.alive = false;
}
}
diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.html b/src/app/shared/log-in/methods/password/log-in-password.component.html
index 0a1c9dcc34..c9a76b5930 100644
--- a/src/app/shared/log-in/methods/password/log-in-password.component.html
+++ b/src/app/shared/log-in/methods/password/log-in-password.component.html
@@ -1,4 +1,5 @@
-