def update_email(strategy, details, user=None, *args, **kwargs):
    """Update the user's email address using data from provider."""
    if user:
        email = details.get('email')
        if email and user.email != email:
            user.email = email
            strategy.storage.user.changed(user)
