-
Notifications
You must be signed in to change notification settings - Fork 116
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
Comments
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).
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. |
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! |
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.
The text was updated successfully, but these errors were encountered: