From 5948c206e85cb52b499e949cdebb2c4ab494aaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Tue, 30 Apr 2019 15:04:43 +0900 Subject: [PATCH] =?UTF-8?q?=E8=AA=8D=E8=A8=BC=E3=81=A3=E3=81=A6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/AuthController.php | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 602b32d..1f5aaeb 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -19,33 +19,32 @@ class AuthController extends Controller { } public function checkSelf(Request $request) { // /api/auth/checkself - $check = $this->checkLegit($request->username, $request->password); + $check = $this->checkLegit($request->kero_token); return array($check); } - public function checkLegit($u, $p) { - if (!isset($u) || !isset($p)) { + public function checkLegit($t) { + if (!isset($t)) { return 0; } $check = DB::table('users') ->select('id') - ->where('username', $u) - ->where('password', $p) + ->where('kero_token', $t) ->first(); return $check->id; } public function getPerms(Request $request) { // /api/auth/getpermissions - $check = $this->getPermissions($request->username, $request->password); + $check = $this->getPermissions($request->kero_token); return array($check); } - public function getPermissions($user, $pass) { - $check = $this->checkLegit($user, $pass); + public function getPermissions($token) { + $check = $this->checkLegit($token); $perm = DB::table('usr_perm_id') ->select('perm_id') @@ -415,9 +414,6 @@ class AuthController extends Controller { return array( 'uid' => $checkName->id, - 'username' => $checkName->username, - 'rawPassword' => $request->password, - 'password' => $checkPass, 'kero_token' => $checkName->kero_token ); } @@ -576,9 +572,8 @@ class AuthController extends Controller { public function checkAuth(Request $request) { $get = DB::table('users') - ->select('id', 'username', 'password', 'kero_token') - ->where('username', $request->username) - ->where('password', $request->password) + ->select('id', 'kero_token') + ->where('kero_token', $request->kero_token) ->first(); $get = json_decode(json_encode($get), true);