joelbutcher / socialstream

OAuth for Laravel, simplified.

Home Page:https://docs.socialstream.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enabling twitter-oauth-2 shows both twitter icons (V1 + OAuth2) on login screen

rgasch opened this issue · comments

Describe the bug
Both the Twitter(V1) and the TwitterOAuth2 login icons are displayed on login screen if only TwitterOAuth2 is configured.

To Reproduce
Steps to reproduce the behavior:

  1. New Laravel + Socialstream install
  2. Enable twitter-oauth-2 by setting the following in config/services.php
'twitter-oauth-2' => [
        'client_id' => env('TWITTER_CLIENT_ID'),
        'client_secret' => env('TWITTER_CLIENT_SECRET'),
        'redirect' => 'https://abc.com/oauth/twitter-oauth-2/callback',
    ],
  1. Enable these features in config/socialstream.php
    'features' => [
        Features::loginOnRegistration(),
        Features::createAccountOnFirstLogin(),
        Features::generateMissingEmails(),
        Features::rememberSession(),
        Features::providerAvatars(),
    ],
  1. Set Twitter OAuth2 entries in .env
  2. Go to /login -> you will now see both the Twitter(V1) and the TwitterOAuth2 login icons.

Expected behavior
Only the TwitterOAuth2 icon should be displayed on the login page as TwitterV1 was not configured.

Environment context

  • Socialstream version: 3.8.0
  • Jetstream stack: Inertia
  • Laravel version: 9.36.3
  • PHP version: 8.1.7

Hi @rgasch thanks for raising this. I've been rather busy with work atm, but hope to get this resolved either this evening or tomorrow - thanks for your patience!

No worries, thank you for your work!

@rgasch I believe there isn't an appropriate fix for this, since both versions of the Twitter OAuth flow behave in slightly different ways. I seem to recall Laravel Socialite having a similar issue raised when Twitter OAuth 2.0 support was introduced. I think the general response was "pick a side" or to similar effect, sorry!

Do you have an urgent requirement to support both OAuth standards for Twitter?

I believe I saw an issue somewhere which said that Socialite can not support both versions of twitter simultaneously ...

Do you have an urgent requirement to support both OAuth standards for Twitter?

No, I just want to use V2 without seeing the login icon for V1 ... no worries though, I might just hack the login template to hide the Twitter V1 button ...