private ClaimsPrincipal CreateInternalClaimsPrincipal(GetHabitsUser internalUser)
        {
            var newClaims = new ClaimsIdentity("application", "fullName", "role");
            newClaims.AddClaim(new Claim("name", internalUser.Name));
            newClaims.AddClaim(new Claim("surname", internalUser.SurName));
            newClaims.AddClaim(new Claim("fullName", internalUser.FullName));
            newClaims.AddClaim(new Claim("email", internalUser.Email));
            newClaims.AddClaim(new Claim("id", internalUser.Id));

            var internalClaimsPrincipal = new ClaimsPrincipal(newClaims);
            return internalClaimsPrincipal;
        }
        private GetHabitsUser PopulateInternalUserFromGoogleClaims(ClaimsPrincipal googleUserClaims)
        {
            GetHabitsUser internalUser = new GetHabitsUser();

            internalUser.ExternalId = googleUserClaims.FindFirst(ClaimTypes.NameIdentifier).Value;
            internalUser.UserName = internalUser.ExternalId;

            internalUser.Name = googleUserClaims.FindFirst(ClaimTypes.GivenName).Value;
            internalUser.FullName = googleUserClaims.FindFirst(ClaimTypes.Name).Value;
            internalUser.SurName = googleUserClaims.FindFirst(ClaimTypes.Surname).Value;

            internalUser.Email = googleUserClaims.FindFirst(ClaimTypes.Email).Value;

            return internalUser;
        }
        private async Task<GetHabitsUser> CreateUser(GetHabitsUser userEntity)
        {
            var result = await _userMng.CreateAsync(userEntity);

            if (!result.Succeeded)
            {
                //if not succeeded do nothing. it's not critical, user whatever can authenticate.
            }

            return userEntity;
        }