To enable Google and GitHub OAuth authentication, follow these steps:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Go to "Credentials" → "Create Credentials" → "OAuth client ID"
- Select "Web application"
- Add authorized redirect URIs:
http://localhost:3000/auth/google_oauth2/callback(for development)https://yourdomain.com/auth/google_oauth2/callback(for production)
- Copy the Client ID and Client Secret
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click "New OAuth App"
- Fill in:
- Application name: Eight
- Homepage URL:
http://localhost:3000(for development) - Authorization callback URL:
http://localhost:3000/auth/github/callback
- Copy the Client ID and Client Secret
Add the OAuth credentials to your Rails credentials file:
rails credentials:editThen add the following structure:
google:
client_id: your_google_client_id_here
client_secret: your_google_client_secret_here
github:
client_id: your_github_client_id_here
client_secret: your_github_client_secret_hereSave and close the editor. Rails will automatically encrypt the credentials.
Start the Rails server with Tailwind CSS compilation:
bin/devThe application will be available at http://localhost:3000