title: Auth0 Angular - Cannot match any route
body: <p>I have an angular application in which I'm trying to integrate with Auth0. I followed these two tutorials:</p>
  
  <p><a href="https://auth0.com/docs/quickstart/spa/angular2/01-login" rel="nofollow noreferrer">https://auth0.com/docs/quickstart/spa/angular2/01-login</a></p>
  
  <p><a href="https://auth0.com/docs/quickstart/spa/angular2/02-calling-an-api" rel="nofollow noreferrer">https://auth0.com/docs/quickstart/spa/angular2/02-calling-an-api</a></p>
  
  <p>Here is the setup of my project:</p>
  
  <p><strong>AuthService</strong></p>
  
  <p>Copy+Pasted from the first tutorial link</p>
  
  <p><strong>LoginController</strong></p>
  
  <pre><code>export class LoginComponent implements OnInit {
  
    constructor(private authService: AuthService) { }
  
    ngOnInit(): void {
        this.authService.login();
    }
  }
  </code></pre>
  
  <p><strong>App-Routing Module</strong></p>
  
  <pre><code>const routes: Routes = [
      { path: 'login', component: LoginComponent },
      { path: 'profile', component: ProfileComponent, resolve: { queues: ProfileResolver}, canActivate: [AuthGuard]}
  ];
  
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule],
    providers: [
      {
        provide: HTTP_INTERCEPTORS,
        useClass: InterceptorService,
        multi: true
      }
    ]
  })
  export class AppRoutingModule { }
  </code></pre>
  
  <p>I'm getting logged in successfully, however when auth0 does its callback, it navigates to <a href="http://localhost:4200/profile?code=[code]&amp;state=[state]" rel="nofollow noreferrer">http://localhost:4200/profile?code=[code]&amp;state=[state]</a>, which then Angular throws "Cannot match any routes". </p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>What are the code and state parameters used for? </li>
  <li>What should I do to properly handle these so my site can route to /profile properly?</li>
  </ol>
  
  <p>Thanks a bunch! </p>