Using Aimeos Authentication with an External React Frontend
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Using Aimeos Authentication with an External React Frontend
Hi everyone,
I’m working on a project using Aimeos for the backend and React for the front end, and I’d like to integrate Aimeos’s authentication features (login, logout, and customer registration) into my external React app.
From what I understand, the Aimeos Laravel package uses Laravel Breeze for authentication. How can I access and use these authentication routes in my React frontend? Are there any specific configurations or steps I must follow to make this work smoothly?
Environment:
OS: macOS
Aimeos version: 2024.07.1
Aimeos Laravel package: https://github.com/aimeos/aimeos-laravel
Any guidance or examples would be greatly appreciated!
Thanks in advance.
I’m working on a project using Aimeos for the backend and React for the front end, and I’d like to integrate Aimeos’s authentication features (login, logout, and customer registration) into my external React app.
From what I understand, the Aimeos Laravel package uses Laravel Breeze for authentication. How can I access and use these authentication routes in my React frontend? Are there any specific configurations or steps I must follow to make this work smoothly?
Environment:
OS: macOS
Aimeos version: 2024.07.1
Aimeos Laravel package: https://github.com/aimeos/aimeos-laravel
Any guidance or examples would be greatly appreciated!
Thanks in advance.
Re: Using Aimeos Authentication with an External React Frontend
Laravel Breeze isn't suitable for a PWA as it provides no API. In the Aimeos headless distribution, we use JWT:
https://github.com/aimeos/aimeos-headle ... n-rest-api
We suggest to use the Aimeos headless distribution instead. If you can't because you want to integrate Aimeos into an existing application, you need to add JWT yourself. You can check the headless distribution as a working example.
https://github.com/aimeos/aimeos-headle ... n-rest-api
We suggest to use the Aimeos headless distribution instead. If you can't because you want to integrate Aimeos into an existing application, you need to add JWT yourself. You can check the headless distribution as a working example.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Using Aimeos Authentication with an External React Frontend
Hi, thanks for your reply!
I’ve successfully integrated the registration route from the auth route into the API route using Aimeos Headless. The registration works, but I noticed that when a customer is registered through the API, the siteid in the customer table is set to null. However, when I create a customer through the Aimeos admin, the siteid is set to 1. The same behavior also occurs when using the register route from the auth route.
Is the siteid required for the customer? Should I manually retrieve and assign the siteid when registering customers through the API?
I’ve successfully integrated the registration route from the auth route into the API route using Aimeos Headless. The registration works, but I noticed that when a customer is registered through the API, the siteid in the customer table is set to null. However, when I create a customer through the Aimeos admin, the siteid is set to 1. The same behavior also occurs when using the register route from the auth route.
Is the siteid required for the customer? Should I manually retrieve and assign the siteid when registering customers through the API?
Re: Using Aimeos Authentication with an External React Frontend
The site ID is important if you have several sites (e.g. in a SaaS setup) and accounts need to be bound to a specific site (e.g. the vendor accounts). Customers with an empty site ID will be available and have access to all sites but only super users can change their data in the admin backend.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Using Aimeos Authentication with an External React Frontend
Hello aimeos,
In my case, we only have one site. So I guess we don't need the siteId for the customers.
In my case, we only have one site. So I guess we don't need the siteId for the customers.
Re: Using Aimeos Authentication with an External React Frontend
Hi everyone,
I have a question about creating a customer using the registration route in the API. I've noticed that when I register a customer, the siteId is not being set, and as a result, the customer cannot be updated in the Aimeos Admin. Is there a specific reason for this behavior?
Thanks in advance for your help!
I have a question about creating a customer using the registration route in the API. I've noticed that when I register a customer, the siteId is not being set, and as a result, the customer cannot be updated in the Aimeos Admin. Is there a specific reason for this behavior?
Thanks in advance for your help!
- Attachments
-
- Screenshot 2024-10-11 at 2.50.13 PM.png (186.7 KiB) Viewed 6313 times
-
- Screenshot 2024-10-11 at 2.46.46 PM.png (57.57 KiB) Viewed 6313 times
Re: Using Aimeos Authentication with an External React Frontend
Like said, only super users can do that for security reasons if the customer record has no site ID set
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star