Hey there,
If I’ve understood correctly your desired flow when installing the app is in this order
- Connect the store with a user record you have
- Go through OAuth the install the app.
It sounds like you need to switch the order these two things, e.g:
- Go through OAuth the install the app.
- Connect the store with a user record you have
Technically this would look something like:
- Check if you have an offline token for this store
- Redirect to OAuth if not
- Check if you have a user record from your database associated wit the store.
- Redirect to a page where they can connect the store with your user record if not.
Does that sound possible?
I think the order matters here because a merchant has to give permission to share data before they actually share data. If a user first connects their store with your user record, then they have not yet given permission to share any data.
Richard