REBELinBLUE\Deployer\Listeners\Events\CreateJwt::handle PHP Method

handle() public method

Handle the event.
public handle ( Illuminate\Auth\Events\Login $event )
$event Illuminate\Auth\Events\Login
    public function handle(Login $event)
    {
        $tokenId = base64_encode(str_random(32));
        $issuedAt = Carbon::now()->timestamp;
        $notBefore = $issuedAt;
        $expire = $notBefore + 3 * 60 * 60;
        // Adding 3 hours
        // Create the token
        $config = ['iat' => $issuedAt, 'jti' => $tokenId, 'iss' => config('app.url'), 'nbf' => $notBefore, 'exp' => $expire, 'data' => ['userId' => $event->user->id]];
        Session::put('jwt', $this->auth->fromUser($event->user, $config));
    }