auth0-8.x-2.4/auth0.module

auth0.module
<?php

/**
 * @file
 * Module definition.
 */

const AUTH0_DEFAULT_SCOPES = 'openid email profile';
const AUTH0_DEFAULT_SIGNING_ALGORITHM = 'RS256';
const AUTH0_DEFAULT_USERNAME_CLAIM = 'nickname';
const AUTH0_MODULE_VERSION = '8.x-2.4';

/**
 * Implements hook_theme().
 */
function auth0_theme() {
  // Replaces a form with the lock widget.
  return [
    'auth0_login' => [
      'template' => 'auth0-login',
      'variables' => [
        'loginCSS' => NULL,
      ],
    ],
  ];
}

/**
 * Implements hook_ENTITY_TYPE_delete().
 */
function auth0_user_delete($account) {
  // Handle users deletion, it should delete the Auth0 profile.
  \Drupal::database()->delete('auth0_user')
    ->condition('drupal_id', $account->uid->value)
    ->execute();
}

/**
 * Implements hook_library_info_build().
 */
function auth0_library_info_build() {
  $config = \Drupal::service('config.factory')->get('auth0.settings');
  return [
    'auth0.widget' => [
      'js' => [
        $config->get('auth0_widget_cdn') => [
          'type' => 'external',
        ],
      ],
    ],
  ];
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc