import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Subscription} from "rxjs";
import {AuthenticationService} from "@app/_services";

@Component({
  templateUrl: 'form.component.html',
  styleUrls: ['form.component.scss']
})
export class AuthFormComponent implements OnInit {
  public subscription: Subscription;

  constructor(private authService: AuthenticationService, private route: ActivatedRoute) {
    this.subscription = this.authService.user.subscribe(user => {
      if (user) window.location.reload();
    });
  }

  ngOnInit() {
  }


  get path() {
    return this.route?.snapshot?.routeConfig?.path;
  }
}
