Ejemplo n.º 1
0
        public async Task EnableUserAsync(Guid key)
        {
            var request = new AdminEnableUserRequest
            {
                Username   = $"{key}",
                UserPoolId = _cognito.UserPool.Id
            };

            await _provider.AdminEnableUserAsync(request);
        }
        public async Task SetAccountEable(string id, bool enabled)
        {
            if (enabled)
            {
                var request = new AdminEnableUserRequest
                {
                    UserPoolId = Configurations.Cognito.CognitoPoolId,
                    Username   = id
                };
                await provider.AdminEnableUserAsync(request);
            }
            else
            {
                var request = new AdminDisableUserRequest
                {
                    UserPoolId = Configurations.Cognito.CognitoPoolId,
                    Username   = id
                };

                await provider.AdminDisableUserAsync(request);
            }
        }