<form data-save-bar></form> redirecting to Login page (Save Bar)

<form data-save-bar></form> redirecting to Login page (Save Bar)

mehmettekn
Shopify Partner
10 0 3

Hi there. 

 

I'm trying to use the AppBridge Save Bar. When the user makes a change in the form, AppBridge shows the save bar. Then, when the user clicks the save button, a post request is sent to the loader function in the /app route.

 

Two problems:

1 - The post request is sent to the loader /app/_index route sometimes. I'm not sure what causes it, but this can be solved by adding the same code to the loader functions in both loaders. (This only happens in the prod server).

 

2—When the post request is made, AppBridge sometimes redirects to the app's login page. I'm not sure when this happens, but it happens about once out of every ten requests. 

 

mehmettekn_0-1727705543534.png

 

 

I'd appreciate it if someone could share their experience with these issues and have a solution. Thanks!

Reply 1 (1)

mehmettekn
Shopify Partner
10 0 3

I solved this. There is apparently a note in the readme file to only use <Form/> apparently. 

 

It reads:

 Use useSubmit or <Form/> from @remix-run/react. Do not use a lowercase <form/>.

 

 

Once switched to the Remix <Form/>, the contextual save bar API works pretty nicely!