Skip to content

Fix modelFor('application') in dummy app's nodes route #5

@samchrisinger

Description

@samchrisinger

The nodes route is trying to fetch the current user (loaded in the application route's model hook-- this.modelFor('application')). Unfortunately the application route's model hook is only run once (when the SPA is first loaded) and there is a slight timing issue between the dummy app's login route (which parses the OAuth token from the query string and "logs in" the user) and when the application route runs. Basically on redirect from the OSF CAS:

ApplicationRoute.model returns null -> LoginRoute parses token and authenticates user -> redirected to index page -> you click "My Nodes", but the ApplicationRoute's model is still null

So when you refresh the page or visit the nodes page directly, the ApplicationRoute is able to correctly fetch the current user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions