Skip to content

Commit

Permalink
fix: GitHub OAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
areknawo committed Jun 19, 2024
1 parent cc6c102 commit cbf39c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/backend/src/plugins/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ const registerGitHubOAuth = (fastify: FastifyInstance): void => {
const newUser = {
_id: new ObjectId(),
email: primaryEmail,
username: userData.data.name.toLowerCase().replace(/-/g, "_").slice(0, 20),
username: (userData.data.name || userData.data.login)
.toLowerCase()
.replace(/-/g, "_")
.slice(0, 20),
salt: await generateSalt(),
external: {
github: { id: userData.data.id }
Expand Down

0 comments on commit cbf39c5

Please sign in to comment.