-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
33 lines (21 loc) · 883 Bytes
/
test.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
<?php
use IconicCodes\LightAuth\LightAuth;
use IconicCodes\LightAuth\LightAuthAdapters\LightAuthJWTAdapter;
use IconicCodes\LightAuth\LRegister;
use IconicCodes\LightAuth\LightAuthLib;
use IconicCodes\LightAuth\LightAuthAdapters\LightAuthSessionAdapter;
use IconicCodes\LightAuth\LightAuthBase;
include "vendor/autoload.php";
$pdo = new PDO("mysql:host=localhost:3306;dbname=testdb", "root", "");
$installer = new LightAuthLib($pdo);
$installer->destroyMySQLTables();
$installer->createMySQLTables();
LightAuthBase::$db = $pdo;
$res = LRegister::register("test", "abc@gmail.com", "1234", 1);
var_dump($res);
$res = LRegister::register("test2", "abc2@gmail.com", "1234", 0);
var_dump($res);
$res = LightAuthSessionAdapter::getUserByEmail('mail2nabeelali@gmail.com', '1233');
var_dump($res);
$res = LightAuthJWTAdapter::loginUser("abc2@gmail.com", "1234");
var_dump($res);