You are here

protected function GALoginTotpSetup::accountName in Google Authenticator login 8

Get account name for QR image.

Return value

string URL encoded string.

1 call to GALoginTotpSetup::accountName()
GALoginTotpSetup::getQrCodeUri in src/Plugin/TfaSetup/GALoginTotpSetup.php
Get a base64 qrcode image uri of seed.

File

src/Plugin/TfaSetup/GALoginTotpSetup.php, line 175

Class

GALoginTotpSetup
TOTP setup class to setup TOTP validation.

Namespace

Drupal\ga_login\Plugin\TfaSetup

Code

protected function accountName() {

  /** @var \Drupal\user\Entity\User $account */
  $account = User::load($this->configuration['uid']);
  $prefix = $this->siteNamePrefix ? preg_replace('@[^a-z0-9-]+@', '-', strtolower(\Drupal::config('system.site')
    ->get('name'))) : $this->namePrefix;
  return urlencode($prefix . '-' . $account
    ->getAccountName());
}