99
1010namespace Pterodactyl \Services \Helpers ;
1111
12+ use Ramsey \Uuid \Uuid ;
1213use Illuminate \Contracts \Hashing \Hasher ;
1314use Illuminate \Database \ConnectionInterface ;
14- use Illuminate \Contracts \Config \Repository as ConfigRepository ;
1515
1616class TemporaryPasswordService
1717{
1818 const HMAC_ALGO = 'sha256 ' ;
1919
20- /**
21- * @var \Illuminate\Contracts\Config\Repository
22- */
23- protected $ config ;
24-
2520 /**
2621 * @var \Illuminate\Database\ConnectionInterface
2722 */
@@ -35,16 +30,11 @@ class TemporaryPasswordService
3530 /**
3631 * TemporaryPasswordService constructor.
3732 *
38- * @param \Illuminate\Contracts\Config\Repository $config
3933 * @param \Illuminate\Database\ConnectionInterface $connection
4034 * @param \Illuminate\Contracts\Hashing\Hasher $hasher
4135 */
42- public function __construct (
43- ConfigRepository $ config ,
44- ConnectionInterface $ connection ,
45- Hasher $ hasher
46- ) {
47- $ this ->config = $ config ;
36+ public function __construct (ConnectionInterface $ connection , Hasher $ hasher )
37+ {
4838 $ this ->connection = $ connection ;
4939 $ this ->hasher = $ hasher ;
5040 }
@@ -57,7 +47,7 @@ public function __construct(
5747 */
5848 public function handle ($ email )
5949 {
60- $ token = hash_hmac (self ::HMAC_ALGO , str_random ( 40 ), $ this -> config -> get ('app.key ' ));
50+ $ token = hash_hmac (self ::HMAC_ALGO , Uuid:: uuid4 ()-> toString (), config ('app.key ' ));
6151
6252 $ this ->connection ->table ('password_resets ' )->insert ([
6353 'email ' => $ email ,
0 commit comments