Skip to content

Comments

fix: Twitter + GitHub login integration [$15]#17

Open
jeffmarcilliat wants to merge 1 commit intoethereumbuilders:masterfrom
jeffmarcilliat:fix/gh-60800
Open

fix: Twitter + GitHub login integration [$15]#17
jeffmarcilliat wants to merge 1 commit intoethereumbuilders:masterfrom
jeffmarcilliat:fix/gh-60800

Conversation

@jeffmarcilliat
Copy link

Summary

This PR implements the solution for #this bounty.

Changes

h service configuration for useraccounts:

  • Added socialLoginStyle: 'popup' option
  • Added AccountsTemplates.addService('twitter') and AccountsTemplates.addService('github')
  1. server/users.js - Updated Accounts.onCreateUser to handle OAuth user creation:

    • Extract username from Twitter screenName or GitHub username
    • Set profile data from OAuth providers
    • Handle avatar URLs from both services
  2. lib/users.js - Updated user helper functions:

    • Added GitHub username fallback to getUserName()
    • Fixed getGitHubName() to use correct field (username instead of screenName)
    • Added getGitHubNameById() helper function
  3. client/views/errors/no_account.html - Updated to include both Twitter and GitHub login buttons

  4. client/views/errors/no_account.js - Added GitHub login event handler alongside existing Twitter handler

  5. packages/cb-theme/lib/client/stylesheets/screen.scss - Added CSS styling for social login buttons

  6. i18n/en.i18n.json - Added i18n translation strings for social login UI

  7. README.md - Added documentation for OAuth configuration

Files Created:

  1. server/oauth_config.js - Server-side OAuth service configuration that reads credentials from Meteor.settings or environment variables

  2. client/views/users/social_login.html - Reusable social login buttons template

  3. client/views/users/social_login.js - Client-side JavaScript for social login button functionality

  4. settings.example.json - Example settings file showing how to configure OAuth credentials

How to Enable Social Login:

  1. Create OAuth apps on Twitter and GitHub developer portals
  2. Copy settings.example.json to settings.json and add your credentials
  3. Run Meteor with: meteor --settings settings.json

The social login buttons will appear on the login page and the "no account" page, allowing users to register and sign in with their Twitter or GitHub accounts.

Files Modified

  • i18n/en.i18n.json
  • settings.example.json
  • client/views/errors/no_account.html
  • README.md
  • lib/users.js
  • meteor/packages
  • packages/cb-theme/lib/client/stylesheets/screen.scss
  • Accounts.onCreateUser
  • client/views/errors/no_account.js
  • server/users.js
  • lib/config/at_config.js
  • client/views/users/social_login.js
  • client/views/users/social_login.html
  • server/oauth_config.js

This PR was generated by Freelance Agent using Claude Code

Implements solution for #N/A

Changes:
- i18n/en.i18n.json
- settings.example.json
- client/views/errors/no_account.html
- README.md
- lib/users.js
- meteor/packages
- packages/cb-theme/lib/client/stylesheets/screen.scss
- Accounts.onCreateUser
- client/views/errors/no_account.js
- server/users.js
- lib/config/at_config.js
- client/views/users/social_login.js
- client/views/users/social_login.html
- server/oauth_config.js

Generated by Freelance Agent using Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant