Laravel-swoole: Authenticated not work

Created on 29 Aug 2018  ·  2Comments  ·  Source: swooletw/laravel-swoole

Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks!
(Any non-English issues will be closed immediately.)

  1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)
    PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul 4 2018 16:55:24) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.7-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies

swoole

swoole support => enabled
Version => 4.0.4
Author => Swoole Group[email: [email protected]]
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu affinity => enabled
spinlock => enabled
rwlock => enabled
async http/websocket client => enabled
pcre => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled

Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608

  1. Please provide your Laravel/Lumen version.

  2. Which release version of this package are you using?
    "laravel/framework": "5.6.*"


after auth with my account
what is miss
Authenticated not work ..return null
what i missed

Websocket::on('connect', function ($websocket, $request) {

// $request->user();
echo auth()->user()->id;

});

question

All 2 comments

Hi @mrosama ,

Please refer to https://github.com/swooletw/laravel-swoole/wiki/7.-Websocket#middleware-for-onopen-event-request. You need to add proper middleware for resolving your authentication.

Hi @mrosama ,

Please refer to https://github.com/swooletw/laravel-swoole/wiki/7.-Websocket#middleware-for-onopen-event-request. You need to add proper middleware for resolving your authentication.

How to Add proper

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiangjiang0228 picture jiangjiang0228  ·  8Comments

omsun123 picture omsun123  ·  6Comments

MikeMaldini picture MikeMaldini  ·  10Comments

junshenshi picture junshenshi  ·  3Comments

JamesKid picture JamesKid  ·  5Comments