Skip to content

Add GitHub OAuth authentication support#983

Merged
skwowet merged 23 commits intolinuxfoundation:mainfrom
skwowet:oauth
Jul 10, 2023
Merged

Add GitHub OAuth authentication support#983
skwowet merged 23 commits intolinuxfoundation:mainfrom
skwowet:oauth

Conversation

@skwowet
Copy link
Copy Markdown
Collaborator

@skwowet skwowet commented Jun 14, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at ce82a79

Added GitHub OAuth integration to the backend and frontend of the application. This allows users to sign in or sign up with their GitHub accounts using authSocial.ts, signin-page.vue, and signup-page.vue.

🤖 Generated by Copilot at ce82a79

We're sailing on the web with GitHub and passport
We've got OAuth to sign in and sign up with a port
So heave away, me hearties, and pull the code along
We'll make our app more user-friendly with a catchy shanty song

Why

Most devs are probably more likely to be logged into GitHub than Google, as mentioned in issue #444 🛠️

Screenshots

Here's how it looks on the signup and login page,

Screenshot 2023-06-14 at 8 27 49 PM Screenshot 2023-06-14 at 8 27 57 PM

How

🤖 Generated by Copilot at ce82a79

  • Enable GitHub OAuth integration in the backend by importing GITHUB_CONFIG from ../../conf (link) and adding two routes to handle the authorization and callback (link) in backend/src/api/auth/authSocial.ts.

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@skwowet
Copy link
Copy Markdown
Collaborator Author

skwowet commented Jun 14, 2023

Extremely sorry for the delay guys, I have been AFK for quite some time, due to my exams 🙂

@jonathimer jonathimer requested review from joanreyero, nunoeufrasio and themarolt and removed request for themarolt June 21, 2023 08:37
@nunoeufrasio
Copy link
Copy Markdown
Contributor

Hi @yeganathan18 :) ...designs specs to consider for the GitHub button to be consistent:

logo should be 20*20px / color: #000 / 12px margin between logo and label;
github-logo

@skwowet
Copy link
Copy Markdown
Collaborator Author

skwowet commented Jun 23, 2023

Hey @nunoeufrasio! 👋 Thanks for the design suggestion. I actually had the same thought because when I visually compare the GitHub logo to Google's, it doesn't seem big enough.

But when I increase the width and height, the logo doesn't actually get bigger, it just takes up more space. It's a bit puzzling, isn't it? 🤔

Screenshot 2023-06-23 at 11 03 22 PM

@skwowet
Copy link
Copy Markdown
Collaborator Author

skwowet commented Jul 7, 2023

I have introduced a new env var in the PR and before testing it out locally, do add the variable in env file.

CROWD_GITHUB_CALLBACK_URL=callback-url

@skwowet skwowet requested a review from epipav July 7, 2023 18:23
Copy link
Copy Markdown
Collaborator

@epipav epipav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work 💪 I made some comments regarding code structure

Comment thread backend/src/services/auth/passportStrategies/githubStrategy.ts Outdated
Comment thread backend/src/services/auth/passportStrategies/githubStrategy.ts Outdated
Comment thread backend/src/api/auth/authSocial.ts
@skwowet skwowet requested a review from epipav July 10, 2023 12:58
@skwowet skwowet changed the title feat: support for OAuth with GitHub Add GitHub OAuth authentication support Jul 10, 2023
@skwowet skwowet added Improvement Created by Linear-GitHub Sync Feature Created by Linear-GitHub Sync and removed Improvement Created by Linear-GitHub Sync labels Jul 10, 2023
@skwowet skwowet merged commit aa05bd6 into linuxfoundation:main Jul 10, 2023
@skwowet skwowet deleted the oauth branch July 10, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants