404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.221.239.169: ~ $
<?php

namespace Laravel\Sanctum\Http\Middleware;

use Illuminate\Auth\AuthenticationException;
use Laravel\Sanctum\Exceptions\MissingAbilityException;

class CheckAbilities
{
    /**
     * Handle the incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  mixed  ...$abilities
     * @return \Illuminate\Http\Response
     *
     * @throws \Illuminate\Auth\AuthenticationException|\Laravel\Sanctum\Exceptions\MissingAbilityException
     */
    public function handle($request, $next, ...$abilities)
    {
        if (! $request->user() || ! $request->user()->currentAccessToken()) {
            throw new AuthenticationException;
        }

        foreach ($abilities as $ability) {
            if (! $request->user()->tokenCan($ability)) {
                throw new MissingAbilityException($ability);
            }
        }

        return $next($request);
    }
}

Filemanager

Name Type Size Permission Actions
CheckAbilities.php File 970 B 0644
CheckForAnyAbility.php File 974 B 0644
CheckForAnyScope.php File 887 B 0644
CheckScopes.php File 874 B 0644
EnsureFrontendRequestsAreStateful.php File 2.3 KB 0644