Here are the routes in my application:
const routes:Routes =[
{path:'', component:WelcomeComponent},
{path:'profile', component: ProfileComponent},
{path:'addcourse', component: AddcourseComponent},
{path:'course', component: CourseComponent},
{path:'editCourse', component: EditCourseComponent},
{path:'addLectures', component: AddLectureComponent},
{path:'login', component:LoginComponent},
{path:'register', component:RegisterComponent},
// { path: 'newform', canActivate:[AuthGuard], component:NewFomComponent},
{ path: '**', redirectTo:'', pathMatch:'full'}
The app is supposed to start with the welcome page, then redirect to the courses page upon clicking login. However, when I try to access a specific course, it redirects me back to the welcome page. Additionally, when I click on login, I encounter the following error:
ERROR Error: Uncaught (in promise): SecurityError: Failed to execute 'pushState' on 'History': A history state object with URL 'http://%28login%29/' cannot be created in a document with origin 'http://localhost:4200' and URL 'http://localhost:4200/'.
Error: Failed to execute 'pushState' on 'History': A history state object with URL 'http://%28login%29/' cannot be created in a document with origin 'http://localhost:4200' and URL 'http://localhost:4200/'.
I have checked the base href in my app and it is set to "/", so there shouldn't be any issues there. Can someone please help me understand what mistake I might be making?