mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
Always apply attributes from token when registering
The change introduced in #1033 transformed any identification attribute returned from an OAuth provider to just a default value. When the identification attribute used by the provider is the email or username, this allowed the user to supply a different email or username and still getting an already-enabled account with the credentials he entered. Skipping attributes with an existing value makes no sense here because it's a always a fresh user and values from AbstractOAuth2Controller::getIdentification() should always be enforced.
This commit is contained in:
parent
140ae49369
commit
31b925164c
|
@ -116,9 +116,7 @@ class RegisterUserHandler
|
|||
// from the get-go.
|
||||
if (isset($token)) {
|
||||
foreach ($token->payload as $k => $v) {
|
||||
if (in_array($user->$k, ['', null], true)) {
|
||||
$user->$k = $v;
|
||||
}
|
||||
$user->$k = $v;
|
||||
}
|
||||
|
||||
if (isset($token->payload['email'])) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user