Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links active class not set after successful login #473

Closed
engwan opened this issue Mar 25, 2015 · 5 comments
Closed

Links active class not set after successful login #473

engwan opened this issue Mar 25, 2015 · 5 comments

Comments

@engwan
Copy link
Contributor

engwan commented Mar 25, 2015

I'm not sure this is an ember-simple-auth issue.

More info here: http://stackoverflow.com/questions/29250684

This only happens when this is called:

attemptedTransition.retry();

and not when this is called:

this.transitionTo(Configuration.routeAfterAuthentication);
@marcoow
Copy link
Member

marcoow commented Mar 25, 2015

This is most likely not an Ember Simple Auth issue - please reopen if it actually turns out to be one.

@marcoow marcoow closed this as completed Mar 25, 2015
@engwan
Copy link
Contributor Author

engwan commented Mar 25, 2015

So I did more investigation into Ember's source code and I logged the parameters to isActiveIntent which is called to check if the current link is active.

It seems that the link's route is compared against application/login instead of the retried transition's route which is application/index

So I guess it's a bug with Ember's retrying of transitions that doesn't update the state properly.

@marcoow
Copy link
Member

marcoow commented Mar 25, 2015

Yes, looks like it. I'd suggest you open an issue on emberjs/ember.js.

@engwan
Copy link
Contributor Author

engwan commented Mar 25, 2015

Yeah, I checked their issues and indeed found these:

emberjs/ember.js#5208

emberjs/ember.js#10557

@mattcoker
Copy link

Just for anyone that stumbles across this in the future, here is a workaround for redirection on authentication. Rather than rely on the routeAfterAuthentication configuration setting, you can manually handle this with the following in your authentication action:

authenticate: function() {
    let credentials = this.getProperties('identification', 'password');
    this.get('session').authenticate('authenticator:jwt', credentials).then(() => {
        this.transitionToRoute('protected');
    }).catch();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants