diff options
author | Marvin Borner | 2018-07-08 17:14:26 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-08 17:14:26 +0200 |
commit | 2b7e31ffa79f508453bc5c759a7511e476cbbe96 (patch) | |
tree | 209ea7974323b0b9270090f4f993ffb1a77085bd /app/Http | |
parent | 8ba38dcf7fbd96a6f13639057e045eba114e2f39 (diff) |
Added basic blockchain-like hashing for verified data
Diffstat (limited to 'app/Http')
-rw-r--r-- | app/Http/Controllers/Auth/RegisterController.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index fb7a4c1..a051071 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -63,10 +63,15 @@ class RegisterController extends Controller */ protected function create(array $data) { + $hashedPassword = Hash::make($data['password']); + $previousHash = User::select('hash')->orderBy('id','desc')->first(); + $summedHash = bcrypt($previousHash . $data['name'] . $data['email'] . 'password' . $hashedPassword); + return User::create([ 'name' => $data['name'], 'email' => $data['email'], - 'password' => Hash::make($data['password']), + 'password' => $hashedPassword, + 'hash' => $summedHash ]); } } |