robsontenorio/vue-api-query

How can I make auth/login and auth/register post queries ?

Closed this issue · 3 comments

I've looked for anything but couldn't find how can I make queries for auth/login and auth/register ? I've created an auth model but that stuck there because custom path's couldn't be used with POST as I can see.

how can I solve this ?

This package does not support auth out of the box. I advice you to install complementar packages like vue-auth or nuxt auth-module.

But, if you want to do it by yourself you can use pure $axios calls.

@iammuho custom() is used for GET, for() is used for POST/PUT/PATCH/DELETE
Reason being that custom() is probably an abstract resource like /posts/latest which would invalidate REST principles if you saved data there. The for() method can be called with multiple arguments to build the resource hierarchy for the URL.
See docs on for() for examples: Relationship operations

@robsontenorio Could the library put a warning in the console? For example set a member variable in custom() so save() can detect that custom() was incorrectly used.

@Peter-Krebs it is possible. Can you open a new issue with that propsal? So we can prpper label it. Thanks!