Skip to content

Commit

Permalink
Fix VerifyCSRF
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnanHussainTurki committed Feb 3, 2021
1 parent 59f70fd commit de63c87
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Routes/SlackRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
use myPHPnotes\Slacker\Controllers\Messages\MessagesController;
use myPHPnotes\Slacker\Controllers\Webhooks\WebhooksController;

class SlackRoute extends \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken {
class SlackRoute {

protected $router;
public function __construct(Router $router)
{
$this->router = $router;
}
public static function routes($prefix = "slacker")
{
Route::get($prefix . '/dashboard', [DashboardController::class, 'index'])->name('slacker.dashboard');
Expand All @@ -26,7 +31,9 @@ public static function routes($prefix = "slacker")

Route::get($prefix . '/channel/{webhook}/webhook/delete', [WebhooksController::class, 'delete'])->name('slacker.channel.webhook.delete');

Route::post($prefix . '/{webhook}/webhook', [WebhooksController::class, 'listen'])->name('slacker.channel.webhook.listen');
$this->router->group(['middleware' => ['web'], function ($router) {
$router->post($prefix . '/{webhook}/webhook', [WebhooksController::class, 'listen'])->name('slacker.channel.webhook.listen');
}
}

}

0 comments on commit de63c87

Please sign in to comment.