Skip to content

Commit

Permalink
Upgrade composer and npm
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisdelicata committed Jul 20, 2024
1 parent 287be7f commit 789be72
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
25 changes: 25 additions & 0 deletions app/Http/Middleware/TeamsPermission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Spatie\Permission\PermissionRegistrar;
use Symfony\Component\HttpFoundation\Response;

class TeamsPermission
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (!empty($user = auth()->user()) && !empty($user->current_team_id)) {
app(PermissionRegistrar::class)->setPermissionsTeamId($user->current_team_id);
}

return $next($request);
}
}
6 changes: 3 additions & 3 deletions config/fortify.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
|
*/

'home' => '/dashboard',
'home' => '/app',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -115,7 +115,7 @@
*/

'limiters' => [
'login' => 'login',
'login' => 'login',
'two-factor' => 'two-factor',
],

Expand Down Expand Up @@ -150,7 +150,7 @@
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirm' => true,
'confirm' => true,
'confirmPassword' => true,
// 'window' => 0,
]),
Expand Down

0 comments on commit 789be72

Please sign in to comment.