When a customer registers on React front-end site, say example.com, an email is sent to customer with a token to confirm email address. The customer opens email and clicks link. i.e http://ip_addrress/api/verify?token=123&email=myemail@example.com.
This link is directed to the server. The server processes the get request and redirects the user to the Front-end. This works ok (IP address is temporary)
The problem is that that the server is sending out a link with the server address and require this to be changed to the front-end address instead (example#com).
The FE has a different domain (example#com) and I have changed the server to send a link as http://example.com/verifyPage?token=123&email=myemail@example.com
Once user clicks this link, it opens a page on Front-end, the link is processed and then the FE sends a GET request to server. The server seems to accepts the request and processes the request (removing the token from DB) but it fails to re-direct the user back to the FE page.
res.redirect(FE.webAddress + '/customer/login?verified=true');
However it fails to re-direct to the FE page, (It does redirect when using the original link to the server - http://ip_addrress/api/verify?token=123&email=myemail@example.com
)
Now that I made the change, should the FE be sending a POST request to server and not a GET?
I’ve tried developer tools and noticed an error but unsure if it is related - ‘CORS Missing Allow Origin’