Trying to only allow access to a webpage via route inside a password confirmation

22
November 08, 2019, at 3:30 PM

I have a function that checks an entered password that then directs them to a webpage if the password is correct.

   export class CreateLoginPageComponent implements OnInit {
  //constructor() { }
  constructor(private router: Router) { }
  ngOnInit() {
  }
  loginUser(event)
  {
    var password = event.target.elements[0].value;
    if(password == 'ABC123')
    {
      this.router.navigate(['create']);
    }
    else{
      this.router.navigate(['create-login']);
    }
  }
    goToPage(pageName: string) {
      this.router.navigate([`${pageName}`]);
    }
}

I would like to block access to the '/create-login' page in all other situations (ie. if they just type in the url is the only other access).

Here is my routing snippet for reference.

   {
path: 'create',
component: CreatePageComponent
},
READ ALSO
MySQL Workbench: “SELECT” is not valid at this position for this server version, expecting : '(', WITH error

MySQL Workbench: “SELECT” is not valid at this position for this server version, expecting : '(', WITH error

I have the following SQL query which I have written in MySQL Workbench:

34
how to insert python in to mysql

how to insert python in to mysql

I am writing an insert statement for python to add data to a mysql database and I am getting an error

19
Python mysql-connector SELECT in loop returns outdated result

Python mysql-connector SELECT in loop returns outdated result

I'm using mysql-connector to run a SELECT query in a while loop to look for new jobs

18