Skip to content

Correct way to redirect #1934

@netwire88

Description

@netwire88

Overview/summary

Hi,
We use Turbolinks and have no trouble using UJS redirect. However, if we need to do a html-based redirect, what is the proper way to do this?

In shopify_app 22.2.1, we used to do the following by adding the shop params already in the original request

In controller (after authentication):

respond_to do |format|
  format.html {
    @redirect_to = edit_orders_path(shop: params[:shop])
  }
end

Then in html.erb, we have:

Turbolinks.visit("<%= @redirect_to %>");

However, in shopify_app 22.5.1, that doesn't work we get ShopifyAPI::Errors::InvalidJwtTokenError, with message "Error decoding session token"

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions