fix(auth): fail closed on token and validation checks
Made-with: Cursor
This commit is contained in:
@@ -7,6 +7,7 @@ namespace app\common\controller;
|
||||
|
||||
use app\Request;
|
||||
use think\App;
|
||||
use think\exception\ValidateException;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
@@ -73,6 +74,10 @@ abstract class AppBaseController
|
||||
$validator->message($scene);
|
||||
}
|
||||
|
||||
return $validator->check($data);
|
||||
if (!$validator->check($data)) {
|
||||
throw new ValidateException($validator->getError());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user