File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed
Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -52,33 +52,21 @@ export const ShopifyPrivateAppDialog = ({
5252
5353 setLoading ( true ) ;
5454 try {
55- // Valider le token en faisant un appel test à l'API Shopify
56- const response = await fetch ( `https://${ shopDomain } /admin/api/2023-10/shop.json` , {
57- headers : {
58- 'X-Shopify-Access-Token' : accessToken ,
59- 'Content-Type' : 'application/json'
60- }
61- } ) ;
62-
63- if ( ! response . ok ) {
64- throw new Error ( 'Token invalide ou boutique inaccessible' ) ;
65- }
66-
67- const data = await response . json ( ) ;
68-
55+ // Pas de validation côté client à cause des problèmes CORS
56+ // La validation se fera côté serveur
6957 toast ( {
70- title : "Connexion réussie ! " ,
71- description : `Connecté à ${ data . shop . name } ` ,
58+ title : "Connexion en cours... " ,
59+ description : "Vérification du token avec votre boutique" ,
7260 } ) ;
7361
7462 onConnect ( accessToken , shopDomain ) ;
7563 onOpenChange ( false ) ;
7664
7765 } catch ( error ) {
78- console . error ( 'Erreur validation token :' , error ) ;
66+ console . error ( 'Erreur connexion :' , error ) ;
7967 toast ( {
8068 title : "Erreur de connexion" ,
81- description : "Vérifiez votre token et réessayez " ,
69+ description : "Une erreur s'est produite " ,
8270 variant : "destructive"
8371 } ) ;
8472 } finally {
You can’t perform that action at this time.
0 commit comments