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

/api/login chokes on onLoggedIn call #2

Closed
hujhax opened this issue Jan 31, 2015 · 7 comments
Closed

/api/login chokes on onLoggedIn call #2

hujhax opened this issue Jan 31, 2015 · 7 comments

Comments

@hujhax
Copy link

hujhax commented Jan 31, 2015

I have a RESTful API set up with useAuth turned on. Whenever I try to access /api/login with a valid username and password, I get this error:

 curl --data "password=123123&user=peter" http://localhost:3000/api/login/
 TypeError: Cannot read property 'config' of undefined
    at [object Object].Restivus.add.post (packages/nimble:restivus/lib/restivus.coffee:93:18)
    at [object Object].Route._callEndpoint (packages/nimble:restivus/lib/route.coffee:121:25)
    at [object Object].Router.route.action (packages/nimble:restivus/lib/route.coffee:40:40)
    at boundNext (packages/iron:middleware-stack/lib/middleware_stack.js:251:1)
    at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)

That spot corresponds to this call in restivus.coffe:
@Restivus.config.onLoggedIn.call this

So presumably something's gone weird with "this" such that this.Restivus is undefined. Maybe an easy fix?

@kahmali
Copy link
Owner

kahmali commented Jan 31, 2015

Shame on me. I'll get the fix up very shortly. The error was introduced in the latest update, so if you want to revert to version 0.5.4 temporarily, you should be fine. Just run meteor add nimble:restivus@0.5.4. Sorry about that. I clearly didn't test extensively enough before the last update. I'm going to setup some automated testing on the package soon. Very soon.

@hujhax
Copy link
Author

hujhax commented Jan 31, 2015

Awesome! Thanks for the prompt reply

@hujhax
Copy link
Author

hujhax commented Jan 31, 2015

No, meteor, don't add 0.5.5... #nooooo:

Peters-iMac:app Peter$ meteor add nimble:restivus@0.5.4

Changes to your project's package version selections:

nimble:restivus  added, version 0.5.5     

@hujhax
Copy link
Author

hujhax commented Jan 31, 2015

Aha -- kahmali meant meteor add nimble:restivus@=0.5.4

@hujhax
Copy link
Author

hujhax commented Jan 31, 2015

Okay, got it authenticating -- I had to roll back to 0.5.3 and explicitly set apiPath: 'api'.

kahmali added a commit that referenced this issue Jan 31, 2015
Make Restivus.\_initAuth() private only by convention for proper
context. Context was accidentally altered when refactoring Restivus into
a class in latest update.
@kahmali
Copy link
Owner

kahmali commented Jan 31, 2015

Sorry for giving you the wrong revert command! Geez. I'm a mess. I just published an update with the fix. Please let me know if you have any issues with the latest version. Thanks so much for reporting this!

@kahmali kahmali closed this as completed Jan 31, 2015
@hujhax
Copy link
Author

hujhax commented Jan 31, 2015

No worries! You got me going in the right direction :), and the newest update works fine. Thanks!

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