Fixed login/logout issue
This commit is contained in:
parent
5e73adada1
commit
0c56440363
@ -14,12 +14,6 @@ use Defuse\Crypto\Key;
|
|||||||
|
|
||||||
class Home
|
class Home
|
||||||
{
|
{
|
||||||
// public $model;
|
|
||||||
//
|
|
||||||
// public function __construct()
|
|
||||||
// {
|
|
||||||
// $this->model = new Access();
|
|
||||||
// }
|
|
||||||
|
|
||||||
/* Routes */
|
/* Routes */
|
||||||
public function index()
|
public function index()
|
||||||
@ -30,11 +24,6 @@ class Home
|
|||||||
|
|
||||||
public function login($args = [])
|
public function login($args = [])
|
||||||
{
|
{
|
||||||
// if (Session::exists('userid')) {
|
|
||||||
// Session::flash('info', 'Anda telah masuk');
|
|
||||||
// Redirect::to('/');
|
|
||||||
// die();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
if ($args) {
|
if ($args) {
|
||||||
@ -105,6 +94,7 @@ class Home
|
|||||||
} else {
|
} else {
|
||||||
$this->delete();
|
$this->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
session_destroy();
|
session_destroy();
|
||||||
header('X-Token: ');
|
header('X-Token: ');
|
||||||
setcookie('signal', '', time()-3600);
|
setcookie('signal', '', time()-3600);
|
||||||
@ -203,44 +193,25 @@ class Home
|
|||||||
|
|
||||||
public function delete($id = '')
|
public function delete($id = '')
|
||||||
{
|
{
|
||||||
// if (Session::exists('userid') == false) {
|
// if ($id) {
|
||||||
// throw new \Exception("Bad request but thrown as 404", 404);
|
// $uid = $id;
|
||||||
// }
|
// } elseif (isset($_SERVER['HTTP_X_TOKEN'])) {
|
||||||
// $client = ClientSession::fetch([
|
// $token = Token::fetch($_SERVER['HTTP_X_TOKEN']);
|
||||||
//
|
// if ($token == '') {
|
||||||
// ])
|
// throw new \Exception("Token invalid");
|
||||||
// $userid = Session::get('userid');
|
// }
|
||||||
//
|
// $uid = $token['uid'];
|
||||||
// $user = Access::showAll([
|
// } elseif (isset($_SERVER['HTTP_X_QUERY'])) {
|
||||||
// ['id', '=', $userid]
|
|
||||||
// ]);
|
|
||||||
// $max_user = $user['max_user'] + 1;
|
|
||||||
//
|
|
||||||
// if (Access::update(
|
|
||||||
// [
|
|
||||||
// 'max_user' => $max_user
|
|
||||||
// ],
|
|
||||||
// $userid
|
|
||||||
// ) != true) {
|
|
||||||
// throw new \Exception("Bad request", 400);
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
|
|
||||||
|
|
||||||
if ($id) {
|
|
||||||
$uid = $id;
|
|
||||||
} elseif (isset($_SERVER['HTTP_X_TOKEN'])) {
|
|
||||||
$token = Token::fetch($_SERVER['HTTP_X_TOKEN']);
|
|
||||||
if ($token == '') {
|
|
||||||
throw new \Exception("Token invalid");
|
|
||||||
}
|
|
||||||
$uid = $token['uid'];
|
|
||||||
} elseif (isset($_SERVER['HTTP_X_QUERY'])) {
|
|
||||||
$query_string = $_SERVER['HTTP_X_QUERY'];
|
$query_string = $_SERVER['HTTP_X_QUERY'];
|
||||||
$exploded = explode('&', $query_string);
|
$exploded = explode('&', $query_string);
|
||||||
$uid = $exploded[1];
|
$uid = $exploded[1];
|
||||||
}
|
$uid = explode('=', $uid);
|
||||||
ClientSession::remove($uid);
|
$uid = $uid[1];
|
||||||
|
// }
|
||||||
|
|
||||||
|
$ip = isset($_SERVER['HTTP_X_FORWADED_FOR']) ? $_SERVER['HTTP_X_FORWADED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
||||||
|
|
||||||
|
ClientSession::remove($ip, $uid);
|
||||||
Access::update(['flag' => 0], $uid);
|
Access::update(['flag' => 0], $uid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -75,14 +75,15 @@ class ClientSession
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function remove($id)
|
public static function remove($ip, $id)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM `client_session` WHERE `uid` = ?";
|
$sql = "DELETE FROM `client_session` WHERE `ip_address` = ? AND `uid` = ?";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db = static::connectDB();
|
$db = static::connectDB();
|
||||||
$query = $db->prepare($sql);
|
$query = $db->prepare($sql);
|
||||||
$query->bindValue(1, $id);
|
$query->bindValue(1, $ip);
|
||||||
|
$query->bindValue(2, $id);
|
||||||
$query->execute();
|
$query->execute();
|
||||||
|
|
||||||
$result = self::fetch(['uid' => $id]);
|
$result = self::fetch(['uid' => $id]);
|
||||||
|
@ -52,46 +52,60 @@ class Router
|
|||||||
public function dispatch($url)
|
public function dispatch($url)
|
||||||
{
|
{
|
||||||
// Check token
|
// Check token
|
||||||
if (isset($_SERVER['HTTP_X-Token'])) {
|
if (isset($_SERVER['HTTP_X_Token'])) {
|
||||||
if (!$this->checkToken($_SERVER['HTTP_X-Token'])) {
|
if (!$this->checkToken($_SERVER['HTTP_X_Token'])) {
|
||||||
// Logout
|
// Logout
|
||||||
$controller = 'Home';
|
$controller = 'Home';
|
||||||
$controller = $this->getNamespace($controller);
|
$controller = $this->getNamespace($controller);
|
||||||
$obj = new $controller();
|
$obj = new $controller();
|
||||||
$obj->logout();
|
$obj->logout();
|
||||||
|
|
||||||
Redirect::to('/mithril');
|
Redirect::to('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$query_string = $this->getQueryStringVariable($url);
|
if ($url != '/login' && $url != '/') {
|
||||||
if ($query_string) {
|
$query_string = $this->getQueryStringVariable($url);
|
||||||
$sessid = explode('=', $query_string[0]);
|
if ($query_string) {
|
||||||
$sessid = $sessid[1];
|
$sessid = explode('=', $query_string[0]);
|
||||||
$userid = explode('=', $query_string[1]);
|
$sessid = $sessid[1];
|
||||||
$userid = $userid[1];
|
$userid = explode('=', $query_string[1]);
|
||||||
|
$userid = $userid[1];
|
||||||
|
|
||||||
// Check if user login
|
// Check if user login
|
||||||
if (is_array(\App\Models\ClientSession::fetch([
|
$session = \App\Models\ClientSession::fetch([
|
||||||
'uid' => $userid,
|
'uid' => $userid,
|
||||||
'id' => $sessid
|
'id' => $sessid
|
||||||
]))) {
|
]);
|
||||||
$token = Token::generate($userid);
|
if (is_array($session)) {
|
||||||
header("X-Token: $token");
|
$token = Token::generate($userid);
|
||||||
}
|
header("X-Token: $token");
|
||||||
} elseif ($query_string == false) {
|
} else {
|
||||||
// echo ['status' => true, 'message' => 'atas'];die();
|
$ip_address = isset($_SERVER['HTTP_X_FORWADED_FOR']) ? $_SERVER['HTTP_X_FORWADED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
||||||
// Get user ip
|
$record = \App\Models\ClientSession::fetch(['ip_address' => $ip_address]);
|
||||||
$ip_address = isset($_SERVER['HTTP_X_FORWADED_FOR']) ? $_SERVER['HTTP_X_FORWADED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
$obj = 'Home';
|
||||||
$record = \App\Models\ClientSession::fetch(['ip_address' => $ip_address]);
|
$obj = $this->getNamespace($obj);
|
||||||
if (is_array($record)) {
|
if (is_array($record)) {
|
||||||
$obj = 'Home';
|
$obj = new $obj();
|
||||||
$obj = $this->getNamespace($obj);
|
$obj->logout($record['uid']);
|
||||||
$obj = new $obj();
|
die();
|
||||||
$obj->logout($record['uid']);
|
} else {
|
||||||
header('Location: http://lepisi.dev/mithril');
|
$obj = new $obj();
|
||||||
// Redirect::to('/mithril');
|
$obj->logout($userid);
|
||||||
die();
|
}
|
||||||
|
header('Location: /');
|
||||||
|
}
|
||||||
|
} elseif ($query_string == false) {
|
||||||
|
$ip_address = isset($_SERVER['HTTP_X_FORWADED_FOR']) ? $_SERVER['HTTP_X_FORWADED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
||||||
|
$record = \App\Models\ClientSession::fetch(['ip_address' => $ip_address]);
|
||||||
|
if (is_array($record)) {
|
||||||
|
$obj = 'Home';
|
||||||
|
$obj = $this->getNamespace($obj);
|
||||||
|
$obj = new $obj();
|
||||||
|
$obj->logout($record['uid']);
|
||||||
|
header('Location: /');
|
||||||
|
die();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +165,7 @@ class Router
|
|||||||
return $parts[0];
|
return $parts[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getQueryStringVariable($url)
|
protected function getQueryStringVariable($url)
|
||||||
{
|
{
|
||||||
$exploded = explode('?', $url);
|
$exploded = explode('?', $url);
|
||||||
if (isset($exploded[1])) {
|
if (isset($exploded[1])) {
|
||||||
|
@ -12,12 +12,48 @@ class RouterApi extends Router
|
|||||||
// Logout
|
// Logout
|
||||||
$obj = new Home();
|
$obj = new Home();
|
||||||
$obj->logout();
|
$obj->logout();
|
||||||
header('Location: /mithril');
|
header('Location: /');
|
||||||
}
|
}
|
||||||
// $request = Token::generate(2);
|
|
||||||
// var_dump($request, Token::validate($request));
|
|
||||||
// return true;
|
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_X_QUERY'])) {
|
||||||
|
// $obj = new Home();
|
||||||
|
// $obj->logout();
|
||||||
|
// header('Location: /');
|
||||||
|
$query_string = $this->getQueryStringVariable($_SERVER['HTTP_X_QUERY']);
|
||||||
|
$sessid = explode('=', $query_string[0]);
|
||||||
|
$sessid = $sessid[1];
|
||||||
|
$userid = explode('=', $query_string[1]);
|
||||||
|
$userid = $userid[1];
|
||||||
|
|
||||||
|
// Check if user login
|
||||||
|
$session = \App\Models\ClientSession::fetch([
|
||||||
|
'uid' => $userid,
|
||||||
|
'id' => $sessid
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (is_array($session)) {
|
||||||
|
$token = Token::generate($userid);
|
||||||
|
header("X-Token: $token");
|
||||||
|
} else {
|
||||||
|
$response = [];
|
||||||
|
$response['status'] = 401;
|
||||||
|
$response['message'] = 'Unauthorized';
|
||||||
|
echo json_encode($response); die();
|
||||||
|
// $ip_address = isset($_SERVER['HTTP_X_FORWADED_FOR']) ? $_SERVER['HTTP_X_FORWADED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
||||||
|
// $record = \App\Models\ClientSession::fetch(['ip_address' => $ip_address]);
|
||||||
|
// $obj = 'Home';
|
||||||
|
// $obj = $this->getNamespace($obj);
|
||||||
|
// if (is_array($record)) {
|
||||||
|
// $obj = new $obj();
|
||||||
|
// $obj->logout($record['uid']);
|
||||||
|
// } else {
|
||||||
|
// $obj = new $obj();
|
||||||
|
// $obj->logout($userid);
|
||||||
|
// }
|
||||||
|
// header('Location: /');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$object = new Api();
|
$object = new Api();
|
||||||
if (isset($this->params['action'])) {
|
if (isset($this->params['action'])) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
let m = require('mithril')
|
let m = require('mithril')
|
||||||
let _ = require('lodash')
|
let _ = require('lodash')
|
||||||
let post = require('./post')
|
let post = require('./post')
|
||||||
|
let user = require('./user')
|
||||||
|
|
||||||
var category = {
|
var category = {
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -36,14 +37,16 @@ var category = {
|
|||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: '/api/kategori',
|
url: '/api/kategori',
|
||||||
data: category.current,
|
data: category.current,
|
||||||
withCredentials: true
|
withCredentials: true,
|
||||||
|
headers: {'x-query': window.location.search}
|
||||||
})
|
})
|
||||||
.then(function(result) {
|
.then(function(result) {
|
||||||
|
console.log(result)
|
||||||
category.current = {}
|
category.current = {}
|
||||||
if (result.status) {
|
if (result.status == true) {
|
||||||
m.route.set('/kategori')
|
m.route.set('/kategori')
|
||||||
} else {
|
} else if (result.status == 401) {
|
||||||
console.log(result)
|
user.logout();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -52,13 +55,15 @@ var category = {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/api/kategori',
|
url: '/api/kategori',
|
||||||
data: category.current,
|
data: category.current,
|
||||||
withCredentials: true
|
withCredentials: true,
|
||||||
|
headers: {'x-query': window.location.search}
|
||||||
})
|
})
|
||||||
.then(function(result) {
|
.then(function(result) {
|
||||||
if (result.status) {
|
console.log(result);
|
||||||
|
if (result.status == true) {
|
||||||
category.loadList()
|
category.loadList()
|
||||||
} else {
|
} else if (result.status == 401) {
|
||||||
console.log(result.status)
|
user.logout()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -38,7 +38,7 @@ var user = {
|
|||||||
url: '/post',
|
url: '/post',
|
||||||
data: user.current,
|
data: user.current,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {client: 'api'}
|
headers: {client: 'api', 'x-query': window.location.search}
|
||||||
})
|
})
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (response.status == true) {
|
if (response.status == true) {
|
||||||
|
@ -116,7 +116,7 @@ eval("var __WEBPACK_AMD_DEFINE_RESULT__;(function (main) {\n 'use strict';\n\n
|
|||||||
/*! all exports used */
|
/*! all exports used */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
eval("let m = __webpack_require__(/*! mithril */ 0)\n\nvar user = {\n current: {},\n login: function() {\n return m.request({\n method: 'POST',\n url: '/login',\n data: user.current,\n withCredentials: true,\n headers: {client: 'api'}\n })\n .then(function(response) {\n if (response.status == true) {\n window.location = response.redirect_to\n } else {\n console.log(response.status);\n }\n })\n },\n logout: function() {\n return m.request({\n method: 'GET',\n url: '/logout',\n withCredentials: true,\n headers: {client: 'api', 'x-query': window.location.search}\n })\n .then(function(response) {\n console.log(response);\n if (response.status) {\n window.location = response.redirect_to\n }\n })\n },\n register: function() {\n return m.request({\n method: 'POST',\n url: '/post',\n data: user.current,\n withCredentials: true,\n headers: {client: 'api'}\n })\n .then(function(response) {\n if (response.status == true) {\n m.route.set(response.route_to)\n } else {\n console.log(response);\n }\n })\n }\n}\n\nmodule.exports = user\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvd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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4\n");
|
eval("let m = __webpack_require__(/*! mithril */ 0)\n\nvar user = {\n current: {},\n login: function() {\n return m.request({\n method: 'POST',\n url: '/login',\n data: user.current,\n withCredentials: true,\n headers: {client: 'api'}\n })\n .then(function(response) {\n if (response.status == true) {\n window.location = response.redirect_to\n } else {\n console.log(response.status);\n }\n })\n },\n logout: function() {\n return m.request({\n method: 'GET',\n url: '/logout',\n withCredentials: true,\n headers: {client: 'api', 'x-query': window.location.search}\n })\n .then(function(response) {\n console.log(response);\n if (response.status) {\n window.location = response.redirect_to\n }\n })\n },\n register: function() {\n return m.request({\n method: 'POST',\n url: '/post',\n data: user.current,\n withCredentials: true,\n headers: {client: 'api', 'x-query': window.location.search}\n })\n .then(function(response) {\n if (response.status == true) {\n m.route.set(response.route_to)\n } else {\n console.log(response);\n }\n })\n }\n}\n\nmodule.exports = user\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2Fzc2V0cy9qcy9tb2RlbHMvdXNlci5qcz9mYTlmIl0sInNvdXJjZXNDb250ZW50IjpbImxldCBtID0gcmVxdWlyZSgnbWl0aHJpbCcpXG5cbnZhci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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///4\n");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 5 */
|
/* 5 */
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user