added user verification option in admin settings

This commit is contained in:
Milos Holba
2021-05-20 21:18:28 +02:00
parent 32bc3bacc0
commit 0139cc92bf
11 changed files with 117 additions and 14 deletions

View File

@@ -14,6 +14,7 @@ use Storage;
use Notification;
use Tests\TestCase;
use App\Models\Folder;
use Illuminate\Support\Facades\URL;
class UserAccountTest extends TestCase
{
@@ -265,10 +266,19 @@ class UserAccountTest extends TestCase
*/
public function it_user_email_verify()
{
// TODO:make request with signature
$user = User::factory(User::class)
->create();
->create([
'email_verified_at' => null
]);
$this->getJson("/api/user/email/verify/$user->id");
$verificationUrl = URL::temporarySignedRoute(
'verification.verify',
now()->addMinutes(60),
['id' => $user->id, 'hash' => sha1($user->email)]
);
$this->getJson($verificationUrl);
$this->assertNotNull($user->email_verified_at);
}