Просмотр исходного кода

Add origin to redirect url for oauth calls

jnfrati 4 лет назад
Родитель
Сommit
0cf770f9b5
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      dashboard/src/components/repo-selector/RepoList.tsx

+ 7 - 3
dashboard/src/components/repo-selector/RepoList.tsx

@@ -175,7 +175,7 @@ const RepoList: React.FC<Props> = ({
           <LoadingWrapper>
             We couldn't reach gitlab to get your repos. You can
             <A
-              to={`/api/projects/${currentProject.id}/oauth/gitlab?integration_id=${currentProvider.integration_id}`}
+              to={`${window.location.origin}/api/projects/${currentProject.id}/oauth/gitlab?integration_id=${currentProvider.integration_id}`}
             >
               Connect your gitlab account to porter
             </A>
@@ -186,7 +186,9 @@ const RepoList: React.FC<Props> = ({
         return (
           <LoadingWrapper>
             No connected Github repos found. You can
-            <A to={"/api/integrations/github-app/install"}>
+            <A
+              to={`${window.location.origin}/api/integrations/github-app/install`}
+            >
               Install Porter in more repositories
             </A>
             or select another git provider.
@@ -278,7 +280,9 @@ const RepoList: React.FC<Props> = ({
                 <div>We couldn't find any git provider to connect with.</div>
                 <div>
                   You can
-                  <A to={"/api/integrations/github-app/install"}>
+                  <A
+                    to={`${window.location.origin}/api/integrations/github-app/install`}
+                  >
                     Add Github repositories
                   </A>
                   or