@iobroker/socket-classes 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -979,35 +979,38 @@ Read all instances of the given adapter, or all instances of all adapters if ada
979
979
  -->
980
980
 
981
981
  ## Changelog
982
+ ### 1.6.2 (2024-12-01)
983
+ * (@GermanBluefox) Caught the error if no authentication and logout called
984
+
982
985
  ### 1.6.1 (2024-10-05)
983
- * (bluefox) Added support of iobroker.SocketIO with typescript
986
+ * (@GermanBluefox) Added support of iobroker.SocketIO with typescript
984
987
 
985
988
  ### 1.5.6 (2024-06-26)
986
- * (bluefox) Corrected call of getObjectView with null parameter
989
+ * (@GermanBluefox) Corrected call of getObjectView with null parameter
987
990
 
988
991
  ### 1.5.5 (2024-06-26)
989
- * (bluefox) updated packages
992
+ * (@GermanBluefox) updated packages
990
993
 
991
994
  ### 1.5.4 (2024-06-02)
992
- * (bluefox) extend `getCompactInstances`method with version information
995
+ * (@GermanBluefox) extend `getCompactInstances`method with version information
993
996
 
994
997
  ### 1.5.2 (2024-05-28)
995
998
  * (foxriver76) ensure compatible `adapter-core` version
996
999
 
997
1000
  ### 1.5.0 (2024-02-22)
998
- * (bluefox) Extended getObjects function with the possibility to read the list of IDs in admin
1001
+ * (@GermanBluefox) Extended getObjects function with the possibility to read the list of IDs in admin
999
1002
 
1000
1003
  ### 1.4.6 (2023-10-19)
1001
- * (bluefox) Added `publishInstanceMessageAll` command
1004
+ * (@GermanBluefox) Added `publishInstanceMessageAll` command
1002
1005
 
1003
1006
  ### 1.4.4 (2023-10-11)
1004
- * (bluefox) Caught errors by subscribe/unsubscribe
1007
+ * (@GermanBluefox) Caught errors by subscribe/unsubscribe
1005
1008
 
1006
1009
  ### 1.4.3 (2023-10-07)
1007
1010
  * (foxriver76) do not await the subscribes anymore
1008
1011
 
1009
1012
  ### 1.4.2 (2023-09-28)
1010
- * (bluefox) Corrected error by unsubscribing on client disconnect
1013
+ * (@GermanBluefox) Corrected error by unsubscribing on client disconnect
1011
1014
 
1012
1015
  ### 1.4.1 (2023-09-12)
1013
1016
  * (foxriver76) do not cancel follow subscribes if one subscribe has an error
@@ -1016,126 +1019,126 @@ Read all instances of the given adapter, or all instances of all adapters if ada
1016
1019
  * (foxriver76) fixed crash on invalid patterns with js-controller version 5
1017
1020
 
1018
1021
  ### 1.3.3 (2023-08-01)
1019
- * (bluefox) Implemented subscribing of a client on messages from specific instance
1020
- * (bluefox) Moved checkFeatureSupported to regular connection and not only admin
1022
+ * (@GermanBluefox) Implemented subscribing of a client on messages from specific instance
1023
+ * (@GermanBluefox) Moved checkFeatureSupported to regular connection and not only admin
1021
1024
 
1022
1025
  ### 1.2.0 (2023-07-07)
1023
1026
  * (foxriver76) fixed crash on invalid patterns with js-controller version 5
1024
- * (bluefox) extended the getObjects function with the possibility to read the list of IDs
1027
+ * (@GermanBluefox) extended the getObjects function with the possibility to read the list of IDs
1025
1028
 
1026
1029
  ### 1.1.5 (2023-03-13)
1027
- * (bluefox) Added command `name`
1030
+ * (@GermanBluefox) Added command `name`
1028
1031
 
1029
1032
  ### 1.1.3 (2023-03-12)
1030
- * (bluefox) Treat `json5` as `json`
1033
+ * (@GermanBluefox) Treat `json5` as `json`
1031
1034
 
1032
1035
  ### 1.1.2 (2023-03-03)
1033
- * (bluefox) Allow deletion of fullcalendar objects
1036
+ * (@GermanBluefox) Allow deletion of fullcalendar objects
1034
1037
 
1035
1038
  ### 1.1.1 (2022-12-22)
1036
- * (bluefox) Corrected error with subscribe
1039
+ * (@GermanBluefox) Corrected error with subscribe
1037
1040
 
1038
1041
  ### 1.1.0 (2022-12-22)
1039
- * (bluefox) Added user check to many commands
1040
- * (bluefox) Downgrade axios to 0.27.2
1042
+ * (@GermanBluefox) Added user check to many commands
1043
+ * (@GermanBluefox) Downgrade axios to 0.27.2
1041
1044
 
1042
1045
  ### 1.0.2 (2022-11-08)
1043
- * (bluefox) Function `getObjects`for web was extended by devices, channels and enums
1046
+ * (@GermanBluefox) Function `getObjects`for web was extended by devices, channels and enums
1044
1047
 
1045
1048
  ### 1.0.1 (2022-10-10)
1046
- * (bluefox) Fixed error with delObject
1049
+ * (@GermanBluefox) Fixed error with delObject
1047
1050
 
1048
1051
  ### 0.5.5 (2022-10-09)
1049
1052
  * (Apollon77) Prepare for future js-controller versions
1050
1053
 
1051
1054
  ### 0.5.4 (2022-09-23)
1052
- * (bluefox) Fixed error in `delObjects` method
1055
+ * (@GermanBluefox) Fixed error in `delObjects` method
1053
1056
 
1054
1057
  ### 0.5.3 (2022-08-24)
1055
- * (bluefox) Caught error by subscribing
1058
+ * (@GermanBluefox) Caught error by subscribing
1056
1059
 
1057
1060
  ### 0.5.2 (2022-08-19)
1058
- * (bluefox) Added command `getCompactSystemRepositories`
1061
+ * (@GermanBluefox) Added command `getCompactSystemRepositories`
1059
1062
 
1060
1063
  ### 0.5.0 (2022-07-20)
1061
- * (bluefox) Buffer conversion errors caught and handled
1064
+ * (@GermanBluefox) Buffer conversion errors caught and handled
1062
1065
 
1063
1066
  ### 0.4.12 (2022-07-08)
1064
- * (bluefox) Corrected getAdapterInstances method
1067
+ * (@GermanBluefox) Corrected getAdapterInstances method
1065
1068
 
1066
1069
  ### 0.4.11 (2022-07-05)
1067
- * (bluefox) Corrected log transportation
1070
+ * (@GermanBluefox) Corrected log transportation
1068
1071
 
1069
1072
  ### 0.4.10 (2022-06-22)
1070
- * (bluefox) Corrected getAdapterInstances
1073
+ * (@GermanBluefox) Corrected getAdapterInstances
1071
1074
 
1072
1075
  ### 0.4.9 (2022-06-20)
1073
- * (bluefox) Do not show error with failed authentication
1076
+ * (@GermanBluefox) Do not show error with failed authentication
1074
1077
 
1075
1078
  ### 0.4.7 (2022-06-20)
1076
- * (bluefox) Allowed overloading system language
1079
+ * (@GermanBluefox) Allowed overloading system language
1077
1080
 
1078
1081
  ### 0.4.6 (2022-06-20)
1079
- * (bluefox) updated `passport`
1082
+ * (@GermanBluefox) updated `passport`
1080
1083
 
1081
1084
  ### 0.4.5 (2022-06-20)
1082
- * (bluefox) allowed running socket.io behind reverse proxy
1085
+ * (@GermanBluefox) allowed running socket.io behind reverse proxy
1083
1086
 
1084
1087
  ### 0.4.4 (2022-06-09)
1085
- * (bluefox) Do not show requireLog message
1088
+ * (@GermanBluefox) Do not show requireLog message
1086
1089
 
1087
1090
  ### 0.4.3 (2022-06-03)
1088
- * (bluefox) Allowed call of getAdapterInstances for non admin
1091
+ * (@GermanBluefox) Allowed call of getAdapterInstances for non admin
1089
1092
 
1090
1093
  ### 0.4.2 (2022-05-23)
1091
- * (bluefox) Corrected renameFile command for admin
1094
+ * (@GermanBluefox) Corrected renameFile command for admin
1092
1095
 
1093
1096
  ### 0.4.1 (2022-05-23)
1094
- * (bluefox) Corrected changePassword command for admin
1097
+ * (@GermanBluefox) Corrected changePassword command for admin
1095
1098
 
1096
1099
  ### 0.4.0 (2022-05-19)
1097
- * (bluefox) Added support of socket.io 4.x
1100
+ * (@GermanBluefox) Added support of socket.io 4.x
1098
1101
 
1099
1102
  ### 0.3.2 (2022-05-19)
1100
- * (bluefox) Hide warn messages
1103
+ * (@GermanBluefox) Hide warn messages
1101
1104
 
1102
1105
  ### 0.3.1 (2022-05-16)
1103
- * (bluefox) Added back compatibility with js-controller@4.0 for `writeDirAsZip`
1106
+ * (@GermanBluefox) Added back compatibility with js-controller@4.0 for `writeDirAsZip`
1104
1107
 
1105
1108
  ### 0.3.0 (2022-05-16)
1106
- * (bluefox) Process `writeDirAsZip` locally
1109
+ * (@GermanBluefox) Process `writeDirAsZip` locally
1107
1110
 
1108
1111
  ### 0.2.1 (2022-05-12)
1109
- * (bluefox) fixed `getObjects` command
1112
+ * (@GermanBluefox) fixed `getObjects` command
1110
1113
 
1111
1114
  ### 0.2.0 (2022-05-09)
1112
- * (bluefox) fixed `delObjects` command
1115
+ * (@GermanBluefox) fixed `delObjects` command
1113
1116
 
1114
1117
  ### 0.1.10 (2022-05-09)
1115
- * (bluefox) Added support for fileChanges
1118
+ * (@GermanBluefox) Added support for fileChanges
1116
1119
 
1117
1120
  ### 0.1.9 (2022-05-07)
1118
- * (bluefox) Corrected readLogs command and implement file subscriptions
1121
+ * (@GermanBluefox) Corrected readLogs command and implement file subscriptions
1119
1122
 
1120
1123
  ### 0.1.7 (2022-05-05)
1121
- * (bluefox) Caught some sentry errors
1124
+ * (@GermanBluefox) Caught some sentry errors
1122
1125
 
1123
1126
  ### 0.1.6 (2022-05-05)
1124
- * (bluefox) fixed `delObject` command
1127
+ * (@GermanBluefox) fixed `delObject` command
1125
1128
 
1126
1129
  ### 0.1.5 (2022-04-25)
1127
- * (bluefox) added updateRatings
1130
+ * (@GermanBluefox) added updateRatings
1128
1131
 
1129
1132
  ### 0.1.4 (2022-04-24)
1130
- * (bluefox) added passportSocket
1133
+ * (@GermanBluefox) added passportSocket
1131
1134
 
1132
1135
  ### 0.1.2 (2022-04-24)
1133
- * (bluefox) initial commit
1136
+ * (@GermanBluefox) initial commit
1134
1137
 
1135
1138
  ## License
1136
1139
  The MIT License (MIT)
1137
1140
 
1138
- Copyright (c) 2020-2024 Bluefox <dogafox@gmail.com>
1141
+ Copyright (c) 2020-2024 @GermanBluefox <dogafox@gmail.com>
1139
1142
 
1140
1143
  Permission is hereby granted, free of charge, to any person obtaining a copy
1141
1144
  of this software and associated documentation files (the "Software"), to deal
@@ -72,7 +72,9 @@ class SocketAdmin extends SocketCommon {
72
72
  // Get user for session
73
73
  return this.adapter.getSession(socket.conn.request.sessionID, obj => {
74
74
  if (!obj || !obj.passport) {
75
- socket._acl.user = '';
75
+ if (socket._acl) {
76
+ socket._acl.user = '';
77
+ }
76
78
  socket.emit(SocketCommon.COMMAND_RE_AUTHENTICATE);
77
79
  callback('Cannot detect user');
78
80
  } else {
@@ -886,7 +886,9 @@ class SocketCommands {
886
886
  this.commands['logout'] = (socket, callback) => {
887
887
  // Logout user
888
888
  // @param {function} callback - function (error)
889
- this.adapter.destroySession(socket._sessionID, callback);
889
+ if (socket.id) {
890
+ this.adapter.destroySession(socket.id, callback);
891
+ }
890
892
  };
891
893
 
892
894
  this.commands['listPermissions'] = (socket, callback) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/socket-classes",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "ioBroker server-side web sockets",
5
5
  "author": {
6
6
  "name": "bluefox",
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@iobroker/adapter-core": "^3.2.2",
25
- "axios": "^1.7.7",
26
- "cookie-parser": "^1.4.6",
25
+ "axios": "^1.7.8",
26
+ "cookie-parser": "^1.4.7",
27
27
  "passport": "^0.7.0"
28
28
  },
29
29
  "devDependencies": {
@@ -33,7 +33,7 @@
33
33
  "chai": "^4.5.0",
34
34
  "gulp": "^4.0.2",
35
35
  "iobroker.js-controller": "^6.0.11",
36
- "mocha": "^10.7.3"
36
+ "mocha": "^10.8.2"
37
37
  },
38
38
  "bugs": {
39
39
  "url": "https://github.com/ioBroker/ioBroker.web/issues"