Skip to content

Commit

Permalink
fix minori
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed Oct 27, 2023
1 parent e900bb0 commit 07b6719
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private function initSocialiteDriver($driver)
}

$config = new \SocialiteProviders\Manager\Config($client_id, $client_secret, $redirect_url);
// @phpstan-ignore-next-line
return Socialite::driver($driver)->setConfig($config);
}

Expand Down
3 changes: 3 additions & 0 deletions code/app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ protected function validator(array $data)
'verify' => [new Captcha()]
];
}
else {
$options = [];
}

$mandatory = $gas->public_registrations['mandatory_fields'];

Expand Down
10 changes: 9 additions & 1 deletion code/app/Models/Concerns/ContactableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public function updateContacts($request)
$contacts[] = $contact->id;
}

$this->contacts()->whereNotIn('id', $contacts)->delete();
$valid_types = Contact::types();
$valid_types = array_keys($valid_types);
$this->contacts()->whereIn('type', $valid_types)->whereNotIn('id', $contacts)->delete();
}

public function addContact($type, $value)
Expand Down Expand Up @@ -119,6 +121,12 @@ public function getMobileAttribute()
return '';
}

/*
Tra i contatti vengono salvate anche informazioni che non sono
propriamente contatti (e.g. gli identificativi per i login social).
Questa funzione è per accedere comodamente solo a quelli il cui type è
mappato come tipo di contatto valido
*/
public function getValidContactsAttribute()
{
$types = Contact::types();
Expand Down

0 comments on commit 07b6719

Please sign in to comment.