summaryrefslogtreecommitdiffstats
path: root/app/Http/Controllers
diff options
context:
space:
mode:
authorAntonio Carlos Ribeiro <acr@antoniocarlosribeiro.com>2016-07-28 18:22:30 -0300
committerAntonio Carlos Ribeiro <acr@antoniocarlosribeiro.com>2016-07-28 18:22:30 -0300
commit6eb76ef0949f1cdaa6e00d2a475e7ae84990d4a8 (patch)
tree0f2b7b091e53b97bd197debfa2518c95ab96b946 /app/Http/Controllers
parent1b07e233527d41e69f3290b3a5542a0ab4e5894c (diff)
downloadgoogle2fa-example-6eb76ef0949f1cdaa6e00d2a475e7ae84990d4a8.zip
google2fa-example-6eb76ef0949f1cdaa6e00d2a475e7ae84990d4a8.tar.gz
google2fa-example-6eb76ef0949f1cdaa6e00d2a475e7ae84990d4a8.tar.bz2
Add key and prefix
Diffstat (limited to 'app/Http/Controllers')
-rw-r--r--app/Http/Controllers/Home.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Http/Controllers/Home.php b/app/Http/Controllers/Home.php
index 31f6a15..7632c17 100644
--- a/app/Http/Controllers/Home.php
+++ b/app/Http/Controllers/Home.php
@@ -15,6 +15,10 @@ class Home extends Controller
private $secretKey;
+ private $keySize = 25;
+
+ private $keyPrefix = '';
+
public function check2fa()
{
$isValid = $this->validateInput();
@@ -53,7 +57,7 @@ class Home extends Controller
{
if (! $key = $this->getStoredKey())
{
- $key = Google2FA::generateSecretKey();
+ $key = Google2FA::generateSecretKey($this->keySize, $this->keyPrefix);
$this->storeKey($key);
}