File tree Expand file tree Collapse file tree
puter-js/src/modules/FileSystem Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1146,8 +1146,8 @@ async function jwt_auth(req){
11461146 else if ( req . query && req . query . auth_token )
11471147 token = req . query . auth_token ;
11481148 // Socket
1149- else if ( req . handshake && req . handshake . query && req . handshake . query . auth_token )
1150- token = req . handshake . query . auth_token ;
1149+ else if ( req . handshake && req . handshake . auth && req . handshake . auth . auth_token )
1150+ token = req . handshake . auth . auth_token ;
11511151
11521152 if ( ! token || token === 'null' )
11531153 throw ( 'No auth token found' ) ;
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ class WebServerService extends BaseService {
158158
159159 // Socket.io middleware for authentication
160160 socketio . use ( async ( socket , next ) => {
161- if ( socket . handshake . query . auth_token ) {
161+ if ( socket . handshake . auth . auth_token ) {
162162 try {
163163 let auth_res = await jwt_auth ( socket ) ;
164164 // successful auth
@@ -168,7 +168,7 @@ class WebServerService extends BaseService {
168168 socket . join ( socket . user . id ) ;
169169 next ( ) ;
170170 } catch ( e ) {
171- console . log ( 'socket auth err' ) ;
171+ console . log ( 'socket auth err' , e ) ;
172172 }
173173 }
174174 } ) ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class FileSystem{
6565 }
6666
6767 this . socket = io ( this . APIOrigin , {
68- query : {
68+ auth : {
6969 auth_token : this . authToken ,
7070 }
7171 } ) ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ async function UIDesktop(options){
4343
4444 // connect socket.
4545 window . socket = io ( window . gui_origin + '/' , {
46- query : {
46+ auth : {
4747 auth_token : window . auth_token
4848 }
4949 } ) ;
You can’t perform that action at this time.
0 commit comments