User Login through REST Api is not working


#1

Hi, I am using meteor-restivus for creating RESTful API in my project. I stucked in userlogin. I’ve gone through documentation, 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, 
}); 

Please take a look and guide me. Thankyou!