import { Component, OnInit } from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';

@Component({
  selector: 'of-pages-auth-confirm-reset-password',
  templateUrl: './confirm-reset-password-page.component.html',
})
export class ConfirmResetPasswordPageComponent implements OnInit {

  token: string;

  constructor(
    private router: Router,
    private activatedRoute: ActivatedRoute,
  ) { }

  ngOnInit() {
    this.token = this.activatedRoute.snapshot.queryParams['token'];
    if (this.token === '' || this.token === null || this.token === undefined ) {
      // warning message print
      console.log('warning message print');
      this.router.navigate(['/']);
    }
  }

  onModifyPassword() {
    console.log(this.token);
    this.router.navigate(['auth/modify-password'], {queryParams: {token: this.token}});
  }

  onSignin() {
    this.router.navigate(['auth/signin']);
  }
}
