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

this.userId is empty in authenticated API endpoints #4

Closed
hujhax opened this issue Feb 2, 2015 · 2 comments
Closed

this.userId is empty in authenticated API endpoints #4

hujhax opened this issue Feb 2, 2015 · 2 comments

Comments

@hujhax
Copy link

hujhax commented Feb 2, 2015

When we have a call that requires authentication, we can still authenticate properly, but this.userId is blank when we reach that code.

This worked in 0.5.3, but was broken in 0.5.4.

Check out this branch, which shows an example of the behavior.

kahmali added a commit that referenced this issue Feb 2, 2015
Resolve and configure endpoints in Route.addToApi() instead of Route
constructor so that endpoints are never configured until the API has
been configured (with Restivus.configure()). This was causing unexpected
behavior in routes that were added before the API was configured, such
as authentication not being checked when necessary (so this.user and
this.userId were undefined in authenticated endpoints).
@kahmali
Copy link
Owner

kahmali commented Feb 2, 2015

I just published v0.5.7 that should fix the issue (and probably create ten more at the rate I'm going). Check out the commit or the change log for more details. If you need a more detailed explanation than what's there just let me know. My plan is to implement some automated testing next weekend to avoid these sneaky bugs when updating in the future. Thanks so much for reporting another issue! I'll try my best to make this a less frequent occurrence for you.

@kahmali kahmali closed this as completed Feb 2, 2015
@hujhax
Copy link
Author

hujhax commented Feb 3, 2015

w00t! Looks like it works fine!

Velocity looks really good, and this package seems conducive to unit tests, so I'm sure you'll get a good test suite together. Good luck!

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

2 participants