0
1
Fork 0
hedera-web-mindshore/rest/core/login.php

29 lines
394 B
PHP
Executable File

<?php
include __DIR__.'/account.php';
class Login extends Vn\Web\JsonRequest
{
function run ($db)
{
try {
Account::trySync ($db
,strtolower ($_POST['user'])
,$_POST['password']
);
}
catch (Exception $e) {}
$token = $this->service->createToken (
$_SESSION['user'],
!empty ($_POST['remember'])
);
return [
'login' => TRUE,
'token' => $token
];
}
}