ember-cliember-simple-auth

ember-simple-auth: Error: Assertion Failed: The route index was not found


I am building an app with the use of ember-simple-auth.

So it looks very much like the library its doing is thing.

Here is what happens:

  1. user tries to access /dashboard but is redirected to /
  2. the route / contains the login form
  3. the user logs in with valid credentials
  4. Server responds: /token 200 0.252 ms - 52
  5. But an error message is shown: Error: Assertion Failed: The route index was not found
  6. user navigates to /dashboard and can now see the content, navigate around protected areas, and successfully log out.

My question is, how do I define /dashboard as the route instead of index? So that after successful login you are redirected to /dashboard


Solution

  • You can configure Ember Simple Auth's routeAfterAuthentication in the config, e.g.

    ENV['ember-simple-auth'] = {
      routeAfterAuthentication: 'dashboard'
    }