Adds BASE_URL to connectIntegrations (#1883)
This commit is contained in:
		
							parent
							
								
									0846d0666b
								
							
						
					
					
						commit
						ecbdfea818
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -2,6 +2,7 @@ import type { IntegrationOAuthCallbackState } from "pages/api/integrations/types
 | 
				
			||||||
import { useState } from "react";
 | 
					import { useState } from "react";
 | 
				
			||||||
import { useMutation } from "react-query";
 | 
					import { useMutation } from "react-query";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { BASE_URL } from "@lib/config/constants";
 | 
				
			||||||
import { AddAppleIntegrationModal } from "@lib/integrations/calendar/components/AddAppleIntegration";
 | 
					import { AddAppleIntegrationModal } from "@lib/integrations/calendar/components/AddAppleIntegration";
 | 
				
			||||||
import { AddCalDavIntegrationModal } from "@lib/integrations/calendar/components/AddCalDavIntegration";
 | 
					import { AddCalDavIntegrationModal } from "@lib/integrations/calendar/components/AddCalDavIntegration";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +18,7 @@ export default function ConnectIntegration(props: {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const mutation = useMutation(async () => {
 | 
					  const mutation = useMutation(async () => {
 | 
				
			||||||
    const state: IntegrationOAuthCallbackState = {
 | 
					    const state: IntegrationOAuthCallbackState = {
 | 
				
			||||||
      returnTo: location.pathname + location.search,
 | 
					      returnTo: BASE_URL + location.pathname + location.search,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    const stateStr = encodeURIComponent(JSON.stringify(state));
 | 
					    const stateStr = encodeURIComponent(JSON.stringify(state));
 | 
				
			||||||
    const searchParams = `?state=${stateStr}`;
 | 
					    const searchParams = `?state=${stateStr}`;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue