finished login stg 1

This commit is contained in:
2018-05-10 09:27:21 -04:00
parent ca630dda67
commit 4bc9c83e38
14 changed files with 2900 additions and 84 deletions

View File

@@ -1,15 +1,32 @@
<?php
/* development only */
header("Access-Control-Allow-Origin: *");
require '../vendor/autoload.php';
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Hmac\Sha256;
$username = $_POST["userName"];
$password = $_POST["password"];
if( $username == "admin" && $password == "admin" ){
$signer = new Sha256();
$token = (new Builder())
->setIssuer("http://pugludos.com")
->setIssuedAt(time())
->set("userName", "ckoch")
->sign($signer, "testing")
->getToken();
$userData = array();
$userDatap["id"] = "12345";
$userDatap["username"] = "admin";
$userDatap["firstName"] = "TestFirst";
$userDatap["lastName"] = "TestLast";
$userDatap["token"] = "fake-jwt-token";
$userDatap["token"] = (string)$token;
echo( json_encode( $userDatap ) );
}else{