Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TikTok username optional based on scopes set #1183

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

Skullbock
Copy link
Contributor

@Skullbock Skullbock commented Mar 28, 2024

In v2, username can be requested only if user.info.profile scope is set.
Instead of forcing the scope, since it's not even in the default list of scopes set in the provider, we could just add the username field if the scope is present.

Closes #1198

@lucasmichot lucasmichot requested a review from atymic March 29, 2024 08:38
Copy link
Member

@atymic atymic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

src/TikTok/Provider.php Outdated Show resolved Hide resolved
@atymic atymic merged commit 501d5c3 into SocialiteProviders:master Apr 29, 2024
3 checks passed
@liamseys
Copy link

I got approved and added this scope, but I still can't see the username.

@liamseys
Copy link

@atymic I debugged this: the username field isn't being passed to the fields list when the scope was added. Was this tested before merging?

@atymic
Copy link
Member

atymic commented Jun 11, 2024

@liamseys can you share the scopes you're using in laravel?

@liamseys
Copy link

@atymic

return Socialite::driver('tiktok')
            ->scopes(['user.info.basic', 'user.info.profile'])
            ->redirect();

@liamseys
Copy link

Scherm­afbeelding 2024-06-12 om 16 13 49

@liamseys
Copy link

array:1 [▼ // vendor/socialiteproviders/tiktok/Provider.php:107
  0 => "user.info.basic"
]

When I print $this->scopes in the Provider.php file, I only see user.info.basic, even though I set more in the scopes method.

@atymic
Copy link
Member

atymic commented Jun 12, 2024

It should merge them correctly
Screen Shot 2024-06-13 at 08 38 25

Can you show your whole controller? Do you set the scopes also when you call ->user();

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.

500 Server Error with TikTok
4 participants