Added remote address arguments.

This commit is contained in:
flash 2024-08-25 22:53:05 +00:00
parent 6a17a53290
commit 926bd02bfc

View file

@ -28,7 +28,7 @@ final class OAuth2RpcActions extends RpcActionHandler {
} }
#[RpcProcedure('hanyuu:oauth2:attemptAppAuth')] #[RpcProcedure('hanyuu:oauth2:attemptAppAuth')]
public function procAttemptAppAuth(string $clientId, string $clientSecret = ''): array { public function procAttemptAppAuth(string $remoteAddr, string $clientId, string $clientSecret = ''): array {
try { try {
$appInfo = $this->appsCtx->getData()->getAppInfo(clientId: $clientId, deleted: false); $appInfo = $this->appsCtx->getData()->getAppInfo(clientId: $clientId, deleted: false);
} catch(RuntimeException $ex) { } catch(RuntimeException $ex) {
@ -54,7 +54,7 @@ final class OAuth2RpcActions extends RpcActionHandler {
} }
#[RpcProcedure('hanyuu:oauth2:attemptBearerAuth')] #[RpcProcedure('hanyuu:oauth2:attemptBearerAuth')]
public function procAttemptBearerAuth(string $token): array { public function procAttemptBearerAuth(string $remoteAddr, string $token): array {
try { try {
$tokenInfo = $this->oauth2Ctx->getTokensData()->getAccessInfo($token, OAuth2TokensData::ACCESS_BY_TOKEN); $tokenInfo = $this->oauth2Ctx->getTokensData()->getAccessInfo($token, OAuth2TokensData::ACCESS_BY_TOKEN);
} catch(RuntimeException $ex) { } catch(RuntimeException $ex) {