Closed amardeep-deligence closed 8 years ago
@amardeep-deligence hi, were u able to resolve this issue? Im also having issues logging in to the API i am building with restivus. please help
@skemb321 Hi, Below code was enough for user authentication var Api = new Restivus({ apiPath: 'api/', version: 'v1', useDefaultAuth: true });
@amardeep-deligence i really wonder what's wrong with mine:
const Api = new Restivus({
useDefaultAuth: true,
prettyJson: true,
version: 'v1',
});
I will try adding apiPath
.
hmmm I've add apiPath but still the same issue :thinking:
Hi, I was using meteor-restivus for creating RESTful API in my project. Im stucked in userlogin. I've gone through documentation again and again, but still not getting my code work properly. URL I am using is: http://localhost:4000/api/login/?password=user&email=user@test.com getting response:(POST request) { status: "error" message: "Unauthorized" }
getting response:(GET request) { status: "error" message: "API endpoint does not exist" }
code for API: var Api = new Restivus({ apiPath: 'api/', auth: { token: 'auth.apiKey', user: function () { return { userId: this.request.headers['user-id'], token: this.request.headers['login-token'] }; } }, prettyJson: true, useDefaultAuth: true, });
I must be missing something, Please take a look. Thankyou!