mirror of
https://gitlab.com/omair-personal/izyim.git
synced 2026-08-19 04:14:05 +00:00
large commit
This commit is contained in:
@@ -22,6 +22,7 @@ class UserInvitationObject
|
||||
* @param int $role
|
||||
* @param string $inviteeEmail
|
||||
* @param null|string $hash
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(int $role, string $inviteeEmail, ?string $hash = null)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Classes\Modules\ControllersLogic\Accounts;
|
||||
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\UserInvitationObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesUserInvitation;
|
||||
use App\Classes\Modules\Accounts\Validation\CanSendAccountInvitation;
|
||||
@@ -42,7 +41,6 @@ class CreateAccountInvitationLogic
|
||||
public function execute(Request $request) {
|
||||
|
||||
try {
|
||||
|
||||
$object = new UserInvitationObject($request->get('role_id'), $request->get('email'));
|
||||
|
||||
if($this->canSendAccountInvitation->execute($object)){
|
||||
|
||||
@@ -9,8 +9,9 @@ final class common
|
||||
/**
|
||||
* @param int $length
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function generateRandomHash(int $length = 10): string {
|
||||
return substr(bin2hex(ceil($length / 2)), 0, $length);
|
||||
return substr(bin2hex(random_bytes(ceil($length / 2))), 0, $length);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user