Skip to content

Commit 757baf1

Browse files
committed
change authorized request
1 parent 8781891 commit 757baf1

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/Exceptions/AuthenticationException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
class AuthenticationException extends RuntimeException
1010
{
11+
public static $authorized = true;
12+
1113
protected $code = 403;
1214

1315
/**
@@ -30,16 +32,19 @@ public static function forUnknownUserProvider(): self
3032

3133
public static function forInvalidCredentials(): self
3234
{
35+
self::$authorized = false;
3336
return new self(lang('RestFul.invalidCredentials'));
3437
}
3538

3639
public static function forNoPassword(): self
3740
{
41+
self::$authorized = false;
3842
return new self(lang('RestFul.noPassword'));
3943
}
4044

4145
public static function forInvalidAccessToken(): self
4246
{
47+
self::$authorized = false;
4348
return new self(lang('RestFul.invalidAccessToken'));
4449
}
4550

src/Exceptions/ValidationException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66

77
class ValidationException extends RuntimeException
88
{
9+
public static $authorized = true;
10+
911
public static function validationtMethodParamsError($param)
1012
{
13+
self::$authorized = false;
1114
$parser = \Config\Services::parser();
1215
return new self($parser->setData(array( 'param' => $param ))->renderString(lang('RestFul.invalidParamsForMethod')));
1316
}
1417

1518
public static function validationData()
1619
{
20+
self::$authorized = false;
1721
return new self('');
1822
}
1923
}

src/RestFul.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function initController(RequestInterface $request, ResponseInterface $res
107107
*/
108108
public function __destruct()
109109
{
110+
log_message('error', 'hhhhh');
110111
if ($this->request) {
111112
$this->_logRequest();
112113

0 commit comments

Comments
 (0)