From fafee351c9b623e75398635292c2380287e23eb2 Mon Sep 17 00:00:00 2001 From: Desmond Obisi Date: Mon, 7 Oct 2024 13:19:51 +0100 Subject: [PATCH 1/3] chore: fix callback in routes --- routes/index.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/routes/index.js b/routes/index.js index 7662a35..23f7357 100644 --- a/routes/index.js +++ b/routes/index.js @@ -156,17 +156,8 @@ const setupRoutes = (app) => { app.get("/api/login", login); //callbacks - if (process.env.NODE_ENV === "production") { - app.post("/api/callback/github", handleOAuthCallback); - } else if (process.env.NODE_ENV === "development") { - app.get("/api/callback/github", handleOAuthCallback); - } - - if (process.env.NODE_ENV === "production") { - app.post("/api/callback/gitlab", handleOAuthCallbackGitlab); - } else if (process.env.NODE_ENV === "development") { - app.get("/api/callback/gitlab", handleOAuthCallbackGitlab); - } + app.post("/api/callback/github", handleOAuthCallback); + app.post("/api/callback/gitlab", handleOAuthCallbackGitlab); app.get("/api/badgedRepos", badgedRepos); app.post("/api/repos-to-badge", reposToBadge); From afea26a95795b312211a5740ddf6614158587489 Mon Sep 17 00:00:00 2001 From: Desmond Obisi Date: Mon, 7 Oct 2024 13:20:11 +0100 Subject: [PATCH 2/3] chore: templates --- .github/ISSUE_TEMPLATE/bug_report.md | 25 +++++++++++++---------- .github/ISSUE_TEMPLATE/doc-feedback.md | 10 ++++----- .github/ISSUE_TEMPLATE/feature_request.md | 8 ++++---- .github/pull_request_template.md | 16 +++++++-------- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7a1889f..a399921 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,11 +1,11 @@ --- name: Bug report about: Create a report to help us improve -title: 'Please provide a concise and informative title that summarizes the issue: - e.g. [BUG] not working for ' +title: + "Please provide a concise and informative title that summarizes the issue: + e.g. [BUG] not working for " labels: bug -assignees: '' - +assignees: "" --- **Describe the bug** @@ -13,6 +13,7 @@ _A clear and concise description of what the bug is. Be specific and clear about **Steps To Reproduce** _List the exact steps someone can take to reproduce the issue._ + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -26,16 +27,18 @@ _If applicable, add screenshots/screen recordings to help explain your problem._ **Desktop specifications** _Please complete the following information if applicable):_ - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] **Smartphone specifications** _Please complete the following information if applicable):_ - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] **Additional context** • Provide any additional information that might help understand the issue. This could include links to relevant code snippets, configuration files, or other resources. diff --git a/.github/ISSUE_TEMPLATE/doc-feedback.md b/.github/ISSUE_TEMPLATE/doc-feedback.md index 52eef94..f5409ad 100644 --- a/.github/ISSUE_TEMPLATE/doc-feedback.md +++ b/.github/ISSUE_TEMPLATE/doc-feedback.md @@ -1,11 +1,11 @@ --- name: Doc feedback about: Help us improve the docs -title: 'Briefly describe the improvement you are requesting e.g. [DOC]: Improve clarity - of X' -labels: '' -assignees: '' - +title: + "Briefly describe the improvement you are requesting e.g. [DOC]: Improve clarity + of X" +labels: "" +assignees: "" --- **Description** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index f592388..b074628 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,11 +1,11 @@ --- name: Feature request about: Suggest an idea for this project -title: 'Please provide a concise and informative title that summarizes the issue: - e.g. [FEATURE]: [Describe the desired feature]' +title: + "Please provide a concise and informative title that summarizes the issue: + e.g. [FEATURE]: [Describe the desired feature]" labels: enhancement -assignees: '' - +assignees: "" --- **Is your feature request related to a problem? Please describe.** diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 16438ac..9837728 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,20 +2,20 @@ **Summary:** -* Briefly describe the changes introduced in this PR. -* Make a reference to the related issue you are resolving. +- Briefly describe the changes introduced in this PR. +- Make a reference to the related issue you are resolving. **Changes:** -* List the specific files modified and a short summary of the changes made. -* Use bullet points for clarity. +- List the specific files modified and a short summary of the changes made. +- Use bullet points for clarity. **Testing:** -* Describe the steps taken to test the changes. -* Mention any automated tests added or modified. +- Describe the steps taken to test the changes. +- Mention any automated tests added or modified. **Additional Notes:** -* Include any relevant information not covered above. -* Ask questions or provide guidance to reviewers. +- Include any relevant information not covered above. +- Ask questions or provide guidance to reviewers. From 8985efa9080408ac363dc9a8b03146a1ada11998 Mon Sep 17 00:00:00 2001 From: Desmond Obisi Date: Mon, 7 Oct 2024 13:32:31 +0100 Subject: [PATCH 3/3] chore: make callback a get request --- routes/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/index.js b/routes/index.js index 23f7357..ce193a9 100644 --- a/routes/index.js +++ b/routes/index.js @@ -156,8 +156,8 @@ const setupRoutes = (app) => { app.get("/api/login", login); //callbacks - app.post("/api/callback/github", handleOAuthCallback); - app.post("/api/callback/gitlab", handleOAuthCallbackGitlab); + app.get("/api/callback/github", handleOAuthCallback); + app.get("/api/callback/gitlab", handleOAuthCallbackGitlab); app.get("/api/badgedRepos", badgedRepos); app.post("/api/repos-to-badge", reposToBadge);