My application starts on a login
page which has a button to a create-account
page.
If I am on the create-account
page and I refresh my browser, it goes back to the login
page.
Why is that? I tried reading through the documentation to find a solution, but it wasn't entirely clear. I can see from the browser that if I manually navigate to http://localhost/create-account
, it returns a 301 and goes back to the login
page. What must be done to the route to fix this in order to allow create-account
to be hit?
Here is my app-routing.module.ts
:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CreateAccountComponent } from './create-account/create-account.component';
import { LoginComponent } from './login/login.component';
import { PasswordResetComponent } from './password-reset/password-reset.component';
const routes: Routes = [
{ path: "login", component: LoginComponent },
{ path: "create-account", component: CreateAccountComponent },
{ path: "password-reset", component: PasswordResetComponent }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }