diff --git a/CHANGELOG.md b/CHANGELOG.md index dbdc486..524e705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,21 @@ ### Fixed - Fix race conditions with plugin initialization. (thanks @nfourtythree). +## 1.0.16 - 2024-07-15 + +### Added +- Add `sendActivationEmail` plugin setting. +- Add the ability to set `data` for a login request, where users might want to store extra information. +- Add Amazon Cognito provider. + +### Changed +- Now requires Craft 4.3.5+. +- Revert callback URI change for `cpTrigger = null` (for detached CPs). + +### Fixed +- Fix race conditions with plugin initialization. (thanks @nfourtythree). +- Fix activation email logic. + ## 1.0.15 - 2024-05-29 ### Added diff --git a/composer.json b/composer.json index 8668df2..f21caff 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "require": { "php": "^8.2", "craftcms/cms": "^5.0.0", - "verbb/auth": "^2.0.3", + "verbb/auth": "^2.0.6", "verbb/base": "^3.0.0" }, "autoload": { diff --git a/src/providers/AmazonCognito.php b/src/providers/AmazonCognito.php new file mode 100644 index 0000000..ac5664a --- /dev/null +++ b/src/providers/AmazonCognito.php @@ -0,0 +1,43 @@ +getUser()->getIdentity(); + // Fetch plugin settings + $settings = SocialLogin::$plugin->getSettings(); + if (!$user) { $user = $this->_getOrCreateUser($provider, $userProfile); @@ -50,6 +53,12 @@ public function loginOrRegisterUser(Provider $provider, Token $token): bool return false; } + } else if ($settings->populateProfile && $settings->syncProfile) { + // Ensure we sync the User's profile on each login/register request. This ensures profile data is synced + // when using an edit profile URL from the SSO provider, for example. + + $user = $this->_syncUserProfile($provider, $user, $userProfile); + Craft::$app->getElements()->saveElement($user); } // Are we resuming an already-logged in session (through the modal login)? Ensure that things match, diff --git a/src/templates/providers/amazon-cognito.html b/src/templates/providers/amazon-cognito.html new file mode 100644 index 0000000..e51c67f --- /dev/null +++ b/src/templates/providers/amazon-cognito.html @@ -0,0 +1 @@ +{% include 'social-login/providers/_oauth' %}