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
WC API v2 - Ability to login customer #6126
Comments
Can you explain your use case more here? Do you want the API to be able to make calls under the context of a user that you create via the API? Or are you wanting it to return the auth cookie for a given user so you can log them in client-side? |
Sounds like what https://wordpress.org/plugins/user-switching/ does *Regards, Jon Ang * On Fri, Aug 29, 2014 at 12:01 PM, Max Rice notifications@github.com wrote:
|
I'm developing a mobile app that uses WooCommerce as a back-end store. I'm pulling all the products via API and allow users to purchase them using the API. During the checkout process user can create an account and this is available via "create customer" method. What is missing is the ability for a user to login next time or on a different device. It will be enough for me to have a method that exchanges username/email with password for a corresponding customer id, so that I can use it to pull customer's orders. Hope it makes sense. |
There's an endpoint to find a customer by email :) |
:-) I can create a method for login if it makes sense for you guys to include it into the API. It will be very similar to registration, but instead of creating a customer it will try to login a user and return user object on success. |
I think I understand what you're asking, though it seems like something your app would need to handle internally. If you can do a quick mock up of the login method you're thinking of, that would be helpful to see what you need 😸 |
I agree that login functionality feels outside of the scope for this module. But at the same time since the current API handles 99% of my needs it feels like an overkill to have a separate API plugin just for the login piece. I'll create a Pull Request once I finish with the login method. |
A new endpoint is implemented and works fine for me. I did a few tests and found no issues. Can you guys take a look and merge it if it looks fine for you as well? Thanks. |
Discussion in #6133 |
@artemkolotilkin please share the endpoint that works for this issue, I am experiencing it too. |
You can find the code in this discussion: |
Has the login ability been added to version 3 of the api? Im trying to build an android app for my woocommerce website and I can't find the password field when I query the table with the rest api client library. I need to build a login page for customers. |
@crushman1 Not and for security reasons it will never be implemented. |
@claudiosmweb I think I understand the security risk, however I to give the customer some sort of login page. What other options do I have? |
Hi,
I've started to use WC API v2 and it works great for me so far. One thing that is missing - the ability to login customer in order to get associated orders and other information. I understand that it may be considered to be out of the scope of this plugin, but since it allows to register customers (POST /customers), it will also make sense to be able to login them. I'd prefer not to use the whole another plugin for that if that could be added into WC API.
Also, this would allow to use WooCommerce as a back-end solution and have a separate front-end app that will handle user registration and login, as well as creating orders, etc.
Let me know your thoughts please.
The text was updated successfully, but these errors were encountered: