Skip to content

Conversation

@adityajha2005
Copy link

Summary

Implements Twitter/X OAuth authentication allowing users to:

  • Connect their X account from the profile page
  • Sign in using their X account on the login page
  • Automatically link X accounts to existing users by email

Changes Made

  • Added OAuth controller with callback and disconnect actions
  • Added twitter_uid field to User model with uniqueness validation
  • Added OAuth routes for Twitter authentication
  • Updated profile page with Connect/Disconnect X buttons
  • Updated login page with "Sign in with X" option
  • Added comprehensive test coverage (5 test files)

Files Modified (6)

  • Gemfile - OAuth gems
  • config/routes.rb - OAuth routes
  • app/models/user.rb - twitter_uid validation
  • Profile & login views - OAuth buttons
  • README.md - Setup instructions

Files Added (5)

  • OAuth controller and initializers
  • Database migration for twitter_uid
  • Comprehensive test suite

Testing

  • All OAuth flows tested (connect, login, disconnect, edge cases)
  • Maintains existing functionality

Resolves #20

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.

OAuth via X

1 participant