-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
38 lines (28 loc) · 801 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare(strict_types=1);
use Kreait\Firebase\Factory;
use Kreait\Firebase\Util\JSON;
require_once __DIR__.'/vendor/autoload.php';
$factory = (new Factory)->withServiceAccount(__DIR__.'/secret/test-cb42f-f9d8f278b806.json');
$auth = $factory->createAuth();
/*
// Remove all users
foreach ($auth->listUsers() as $user) {
$auth->deleteUser($user->uid);
}
*/
/*
// Insert user
$userProperties = [
'email' => '[email protected]',
'displayName' => 'jon snow',
'password' => 'azerty',
'emailVerified' => true,
'disabled' => false
];
$createdUser = $auth->createUser($userProperties);
*/
$actionCodeSettings = [
'continueUrl' => 'http://localhost/zone42/testfirebase/page2.php'
];
$auth->sendSignInWithEmailLink('[email protected]', $actionCodeSettings);