Turbolinks and Ruby Shopify_app 20.1

Viewed 16

My shopify app uses shopify_app 19 and turbolinks to load the code into the embedded app:

Turbolinks.visit(data.loadPath); 

Until today, I just needed to add the session value in the header:

xhr.setRequestHeader("Authorization", "Bearer " + AppBridge.sessionToken); 

But after I upgraded to the new 20.1.0 version, nothing is working. Looking into the code:

https://github.com/Shopify/shopify_app/blob/main/lib/shopify_app/controller_concerns/login_protection.rb#L222

apparently now the app is expecting that I must send the "session":

params[:session].present? 

and "shop" params (values) on each single request. But I don't know how to do that with Turbolinks.

0 Answers
Related