Browse Source

major bugfixes

Ivan Galakhov 4 years ago
parent
commit
f8eca64a75

+ 4 - 6
dashboard/src/components/repo-selector/RepoList.tsx

@@ -39,8 +39,8 @@ const RepoList: React.FC<Props> = ({
           .then(async (res) => {
             resolve(res.data);
           })
-          .catch((err) => {
-            reject(err);
+          .catch(() => {
+            resolve([]);
           });
       } else {
         reject(null);
@@ -119,10 +119,8 @@ const RepoList: React.FC<Props> = ({
       return (
         <LoadingWrapper>
           No connected Github repos found. You can
-          <A
-            href={`/api/oauth/projects/${currentProject.id}/github?redirected=true`}
-          >
-            log in with GitHub
+          <A href={"/api/integrations/github-app/install"}>
+            Install Porter in more repositories
           </A>
           .
         </LoadingWrapper>

+ 0 - 9
server/api/oauth_github_handler.go

@@ -323,15 +323,6 @@ func (app *App) HandleGithubAppOAuthCallback(w http.ResponseWriter, r *http.Requ
 		return
 	}
 
-	if r.URL.Query().Get("state") != session.Values["state"] {
-		if session.Values["query_params"] != "" {
-			http.Redirect(w, r, fmt.Sprintf("/dashboard?%s", session.Values["query_params"]), 302)
-		} else {
-			http.Redirect(w, r, "/dashboard", 302)
-		}
-		return
-	}
-
 	token, err := app.GithubAppConf.Exchange(oauth2.NoContext, r.URL.Query().Get("code"))
 
 	if err != nil || !token.Valid() {