feat(shopify): Support Shopify-initiated install flow and improve integration page

This commit is contained in:
Muhsin
2026-02-13 13:14:04 +05:30
parent 2c2f0547f7
commit 434d621dc4
14 changed files with 163 additions and 31 deletions
+2
View File
@@ -12,6 +12,7 @@ import {
export const login = async ({
ssoAccountId,
ssoConversationId,
redirectUrl,
...credentials
}) => {
try {
@@ -31,6 +32,7 @@ export const login = async ({
window.location = getLoginRedirectURL({
ssoAccountId,
ssoConversationId,
redirectUrl,
user: response.data.data,
});
return null;
+8
View File
@@ -40,8 +40,16 @@ export const getCredentialsFromEmail = email => {
export const getLoginRedirectURL = ({
ssoAccountId,
ssoConversationId,
redirectUrl,
user,
}) => {
if (redirectUrl) {
const { accounts = [], account_id = null } = user || {};
const accountId = account_id || accounts[0]?.id;
if (accountId) {
return frontendURL(`accounts/${accountId}/${redirectUrl}`);
}
}
const accountPath = getSSOAccountPath({ ssoAccountId, user });
if (accountPath) {
if (ssoConversationId) {
+5 -1
View File
@@ -29,7 +29,11 @@ export const validateRouteAccess = (to, next, chatwootConfig = {}) => {
// Redirect to dashboard if a cookie is present, the cookie
// cleanup and token validation happens in the application pack.
if (hasAuthCookie()) {
replaceRouteWithReload(DEFAULT_REDIRECT_URL);
const { redirect_url: redirectUrl } = to.query || {};
const redirectTarget = redirectUrl
? `${DEFAULT_REDIRECT_URL}?redirect_url=${encodeURIComponent(redirectUrl)}`
: DEFAULT_REDIRECT_URL;
replaceRouteWithReload(redirectTarget);
return;
}
+2
View File
@@ -43,6 +43,7 @@ export default {
ssoConversationId: { type: String, default: '' },
email: { type: String, default: '' },
authError: { type: String, default: '' },
redirectUrl: { type: String, default: '' },
},
setup() {
const { replaceInstallationName } = useBranding();
@@ -169,6 +170,7 @@ export default {
sso_auth_token: this.ssoAuthToken,
ssoAccountId: this.ssoAccountId,
ssoConversationId: this.ssoConversationId,
redirectUrl: this.redirectUrl,
};
login(credentials)
+1
View File
@@ -19,6 +19,7 @@ export default [
ssoAccountId: route.query.sso_account_id,
ssoConversationId: route.query.sso_conversation_id,
authError: route.query.error,
redirectUrl: route.query.redirect_url,
}),
},
{