The following was added in to this PR to connect Cognito Groups, allowing administrators to manage user groups from the Cognito interface:
RegistersUsers Trait: Added a function called setDefaultGroup which looks for a config item called cognito.default_user_group, and if it exists calls the Cognito Admin API to add the user to the group.
Calls the above function from the register function in the same trait
Adds the following to the AwsCognitoClient Class:
-- adminAddUserToGroup to add a user to a given group
-- adminListGroupsForUser which returns groups a user belongs to - this can be used in the application code to get the user's known groups, or synchronize a local data store with info from Cognito
Adds getAdminListGroupsForUser to the AuthenticatesUsers trait, to pull the above functionality up to the application code
Fixed a bug found in createLocalUser function in AuthenticatesUsers trait, which was throwing an error in Laravel 9 running on PHP 7.4
The following was added in to this PR to connect Cognito Groups, allowing administrators to manage user groups from the Cognito interface:
cognito.default_user_group
, and if it exists calls the Cognito Admin API to add the user to the group.register
function in the same traitAwsCognitoClient
Class: --adminAddUserToGroup
to add a user to a given group --adminListGroupsForUser
which returns groups a user belongs to - this can be used in the application code to get the user's known groups, or synchronize a local data store with info from CognitogetAdminListGroupsForUser
to theAuthenticatesUsers
trait, to pull the above functionality up to the application codecreateLocalUser
function in AuthenticatesUsers trait, which was throwing an error in Laravel 9 running on PHP 7.4