- if ($this->checkToken()) {
- if ($this->app->getRequest()->getRequestMethod() != "POST") {
- // user had to re-authenticate, and was redirected here
- $this->app->redirect($this->app->getBaseUrl()->mod([
- "path" => "./github/repo/" . $args["owner"] ."/". $args["name"],
- "query" => "modal=hook&hook=" . $args["action"]
- ]));
- } else {
- $this->changeHook($args)->done(function() use($args) {
- $this->redirectBack($args["owner"]."/".$args["name"]);
- });
- $this->github->drain();
- }
+ if (!$this->checkToken()) {
+ return;
+ }
+ if ($this->app->getRequest()->getRequestMethod() != "POST") {
+ // user had to re-authenticate, and was redirected here
+ $this->app->redirect($this->app->getBaseUrl()->mod([
+ "path" => "./github/repo/" . $args["owner"] ."/". $args["name"],
+ "query" => "modal=hook&hook=" . $args["action"]
+ ]));
+ } else {
+ $this->changeHook($args)->done(function() use($args) {
+ $this->redirectBack($args["owner"]."/".$args["name"]);
+ });
+ $this->github->drain();