feat(integrations): expose oauth callbacks

This commit is contained in:
2026-06-06 09:57:47 +08:00
parent 6b9049d284
commit 85819489b9
10 changed files with 580 additions and 12 deletions
@@ -36,7 +36,7 @@ func (h *ShopifyIntegrationHandler) Delete(c *gin.Context) {
response.OK(c, gin.H{"message": "Shopify integration deleted"})
}
// Auth creates/updates Shopify OAuth credentials.
// Auth returns the Shopify OAuth authorize URL.
// POST /api/v1/accounts/:account_id/integrations/shopify/auth
func (h *ShopifyIntegrationHandler) Auth(c *gin.Context) {
accountID, err := parseUintParam(c, "account_id")
@@ -51,12 +51,12 @@ func (h *ShopifyIntegrationHandler) Auth(c *gin.Context) {
return
}
hook, svcErr := h.svc.Auth(c.Request.Context(), accountID, req)
redirect, svcErr := h.svc.BuildAuthRedirect(c.Request.Context(), accountID, req)
if svcErr != nil {
handleServiceError(c, svcErr)
return
}
response.OK(c, hook)
response.OK(c, redirect)
}
// GetOrders retrieves Shopify orders for an account.