how to override module's theme function in a custom module? I'm a Drupal8 newbie. I installed a third party module simplelogin, and I attempted to change the {{site_name}} value in page--simplelogin.html.twig but can not find a right way. 

I noticed that the variable is defined in simplelogin.module:

function simplelogin_preprocess_simplelogin(&amp;$variables) {
  $path = \Drupal::service('path.current')-&gt;getPath();
  $module_path = drupal_get_path('module', 'simplelogin');

  $variables['#attached']['library'][] = 'simplelogin/simplelogin-library';

  // Able to use custom variables
  $variables['path'] = $path;
  $variables['base_path'] = base_path();
  $variables['logo'] = file_url_transform_relative(file_create_url(theme_get_setting('logo.url')));
  $variables['background_class'] = simple_login_settings('active');
  $variables['background_opacity'] = simple_login_settings('opacity');
  $variables['wrapper_width'] = simple_login_settings('width');
  $variables['site_name'] = \Drupal::config('system.site')-&gt;get('name');
  $variables['site_register'] = \Drupal::config('user.settings')-&gt;get('register');
}


I guess the second "simplelogin" presented in the hook function is a form element in the theme (I'm not quite clear although), as I found $form['simplelogin'] appears in the buildForm function of form controller.

  public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL) {

    $form_state-&gt;disableCache();

    $simplelogin_config = $this-&gt;config('simplelogin.settings');

    $imageid = $simplelogin_config-&gt;get('background_image');
    if ($imageid) {
      $file = \Drupal\file\Entity\File::load($imageid[0]);  // File Load 
      $fileUrl = $file-&gt;getFileUri();

      // check if image is valid.
      $image = \Drupal::service('image.factory')-&gt;get($fileUrl);
      if ($image-&gt;isValid()) {
        $image_render = array(
          '#theme' =&gt; 'image_style',
          '#width' =&gt; $image-&gt;getWidth(),
          '#height' =&gt; $image-&gt;getHeight(),
          '#style_name' =&gt; 'medium',
          '#uri' =&gt; $fileUrl,
        );
      }
    }
    //$renderer = \Drupal::service('renderer');
    //$renderer-&gt;addCacheableDependency($image_render, $file);

    $form['simplelogin'] = array(
      '#type'            =&gt; 'details',
      '#title'           =&gt; $this-&gt;t('Configuration'),
      '#open'            =&gt; TRUE,

      'background_active' =&gt; array(


WHAT I HAVE DONE:
                                                                                                  1. created a custom module named "mylogin", this is the info.yml:

name: myLogin
description: my login module
type: module

version: '8.x-1.0'
package: 8.x
core: '8.x'
project: 'mylogin'

dependencies:
  - simplelogin


2. override hook_preprocess_page in mylogin.module:

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\file\Entity\File;
use Drupal\Core\Controller\ControllerBase;
use Drupal\simplelogin\Controller;

function mylogin_preprocess_page(&amp;$variables) {
  if (\Drupal::routeMatch()-&gt;getRouteName() == 'user.login') {
    $variables['site_name']= 'test';
  }
}


But it cannot work, and I believe the preprocess is not triggered. Is there a simple way to override the needed variable while keep the others in the module's preprocess function? Any help will be very appreciated.
You can create a new module use hook_theme_registry_alter like module simplelogin
like this:

/**
 * Implements hook_theme_registry_alter
 *
 * {@inheritdoc}
 */
function YOUR_MODULE_theme_registry_alter(&amp;$theme_registry) {
  $theme_registry['page__simplelogin'][preprocess functions] = [
    0 =&gt; 'simplelogin_preprocess_simplelogin',
    1 =&gt; 'YOUR_MODULE_preprocess_function'
  ];
}