Skip to content

Commit a261665

Browse files
committed
Add token hook configuration
Depends on platformsh/platformsh-oauth2-php#6
1 parent 7e0350c commit a261665

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/Connection/Connector.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -423,19 +423,18 @@ protected function getOauthMiddleware()
423423
$this->oauthMiddleware->setAccessToken($accessToken);
424424
}
425425

426-
// @todo
427-
// if ($this->config['on_refresh_start'] !== null) {
428-
// $this->oauth2Plugin->setOnRefreshStart($this->config['on_refresh_start']);
429-
// }
430-
// if ($this->config['on_refresh_end'] !== null) {
431-
// $this->oauth2Plugin->setOnRefreshEnd($this->config['on_refresh_end']);
432-
// }
433-
// if ($this->config['on_refresh_error'] !== null) {
434-
// $this->oauth2Plugin->setOnRefreshError($this->config['on_refresh_error']);
435-
// }
436-
// if ($this->config['on_step_up_auth_response'] !== null) {
437-
// $this->oauth2Plugin->setOnStepUpAuthResponse($this->config['on_step_up_auth_response']);
438-
// }
426+
if ($this->config['on_refresh_start'] !== null) {
427+
$this->oauthMiddleware->setOnRefreshStart($this->config['on_refresh_start']);
428+
}
429+
if ($this->config['on_refresh_end'] !== null) {
430+
$this->oauthMiddleware->setOnRefreshEnd($this->config['on_refresh_end']);
431+
}
432+
if ($this->config['on_refresh_error'] !== null) {
433+
$this->oauthMiddleware->setOnRefreshError($this->config['on_refresh_error']);
434+
}
435+
if ($this->config['on_step_up_auth_response'] !== null) {
436+
$this->oauthMiddleware->setOnStepUpAuthResponse($this->config['on_step_up_auth_response']);
437+
}
439438
}
440439

441440
return $this->oauthMiddleware;

0 commit comments

Comments
 (0)