Cannot authenticate with Mac Client using latest (`6.0.0-rc10`)
bayu01 opened this issue · 3 comments
Hi, I'm using the latest released version available on npmjs (https://www.npmjs.com/package/league-connect) which is 6.0.0-rc10 and my app doesn't run from mac sometimes.
- Usage Example:
import { authenticate } from "league-connect";
import { createWebSocketConnection } from "league-connect";
const credentials = await authenticate();
const ws = await createWebSocketConnection({
authenticationOptions: {
awaitConnection: true,
},
});
- Stacktrace:
node:internal/process/esm_loader:97
internalBinding('errors').triggerUncaughtException(
^
ErrorEvent {
[Symbol(kTarget)]: LeagueWebSocket {
_events: [Object: null prototype] {
open: [
[Function (anonymous)],
[Function: onOpen] {
[Symbol(kIsForOnEventAttribute)]: true,
[Symbol(kListener)]: [Function (anonymous)]
}
],
message: [Function (anonymous)],
error: [Function: onError] {
[Symbol(kIsForOnEventAttribute)]: true,
[Symbol(kListener)]: [Function (anonymous)]
}
},
_eventsCount: 3,
_maxListeners: undefined,
_url: 'wss://riot:fB_htNn4GqNLW8NKxPqN8A--app-port@127.0.0.1:55704',
...
[Symbol(kError)]: Error: Unexpected server response: 401
at ClientRequest.<anonymous> (/Users/pedrojacques/workspace/solid-train/local-agent-js/node_modules/ws/lib/websocket.js:888:7)
at ClientRequest.emit (node:events:513:28)
at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
at TLSSocket.socketOnData (node:_http_client:534:22)
at TLSSocket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23),
[Symbol(kMessage)]: 'Unexpected server response: 401'
Findings
By running locally ps x -o args | grep 'LeagueClientUx'
(full output below).
Relevant bits:
--plugins-mask=4 --remoting-auth-token=fB_htNn4GqNLW8NKxPqN8A --app-port=55704
Full output:
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/MacOS/LeagueClientUx --riotclient-auth-token=pNCkLEUQG7AWVPaoVTTJyQ --riotclient-app-port=55042 --no-rads --disable-self-update --region=LA1 --locale=es_MX --riotgamesapi-standalone --riotgamesapi-settings=shortenedOnPurpose --plugins-mask=4 --remoting-auth-token=fB_htNn4GqNLW8NKxPqN8A --app-port=55704 --install-directory=/Applications/League of Legends.app/Contents/LoL --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --app-pid=36865 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --no-proxy-server --ignore-certificate-errors
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/LeagueClientUx Helper (GPU).app/Contents/MacOS/LeagueClientUx Helper (GPU) --type=gpu-process --field-trial-handle=1718379636,6221943327936792679,7564310403994520756,131072 --disable-features=CookiesWithoutSameSiteMustBeSecure,HardwareMediaKeyHandling,SameSiteByDefaultCookies --no-sandbox --framework-dir-path=/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/Chromium Embedded Framework.framework --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --user-agent-product=LeagueOfLegendsClient/13.5.497.3109 (CEF 91) --lang=en-US --gpu-preferences=shortenedOnPurpose+shortenedOnPurpose --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --shared-files --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --app-port=55704 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --primary-ux-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-29_36887_LeagueClientUx.log
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/LeagueClientUx Helper.app/Contents/MacOS/LeagueClientUx Helper --type=utility --utility-sub-type=network.mojom.NetworkService --field-trial-handle=1718379636,6221943327936792679,7564310403994520756,131072 --disable-features=CookiesWithoutSameSiteMustBeSecure,HardwareMediaKeyHandling,SameSiteByDefaultCookies --lang=en-US --service-sandbox-type=network --no-sandbox --use-mock-keychain --framework-dir-path=/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/Chromium Embedded Framework.framework --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --user-agent-product=LeagueOfLegendsClient/13.5.497.3109 (CEF 91) --lang=en-US --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --shared-files --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --app-port=55704 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --primary-ux-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-29_36887_LeagueClientUx.log
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/LeagueClientUx Helper (Renderer).app/Contents/MacOS/LeagueClientUx Helper (Renderer) --type=renderer --no-sandbox --autoplay-policy=no-user-gesture-required --enable-viewport --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --field-trial-handle=1718379636,6221943327936792679,7564310403994520756,131072 --disable-features=CookiesWithoutSameSiteMustBeSecure,HardwareMediaKeyHandling,SameSiteByDefaultCookies --lang=en-US --framework-dir-path=/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/Chromium Embedded Framework.framework --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --user-agent-product=LeagueOfLegendsClient/13.5.497.3109 (CEF 91) --disable-extensions --disable-scroll-bounce --disable-spell-checking --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --app-port=55704 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --primary-ux-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-29_36887_LeagueClientUx.log
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/LeagueClientUx Helper (Renderer).app/Contents/MacOS/LeagueClientUx Helper (Renderer) --type=renderer --no-sandbox --autoplay-policy=no-user-gesture-required --enable-viewport --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --field-trial-handle=1718379636,6221943327936792679,7564310403994520756,131072 --disable-features=CookiesWithoutSameSiteMustBeSecure,HardwareMediaKeyHandling,SameSiteByDefaultCookies --lang=en-US --framework-dir-path=/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/Chromium Embedded Framework.framework --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --user-agent-product=LeagueOfLegendsClient/13.5.497.3109 (CEF 91) --disable-extensions --disable-scroll-bounce --disable-spell-checking --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=4 --no-v8-untrusted-code-mitigations --shared-files --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --app-port=55704 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --primary-ux-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-29_36887_LeagueClientUx.log
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/LeagueClientUx Helper.app/Contents/MacOS/LeagueClientUx Helper --type=utility --utility-sub-type=audio.mojom.AudioService --field-trial-handle=1718379636,6221943327936792679,7564310403994520756,131072 --disable-features=CookiesWithoutSameSiteMustBeSecure,HardwareMediaKeyHandling,SameSiteByDefaultCookies --lang=en-US --service-sandbox-type=audio --no-sandbox --use-mock-keychain --message-loop-type-ui --framework-dir-path=/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/Chromium Embedded Framework.framework --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --user-agent-product=LeagueOfLegendsClient/13.5.497.3109 (CEF 91) --lang=en-US --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --shared-files --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --app-port=55704 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --primary-ux-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-29_36887_LeagueClientUx.log
/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/LeagueClientUx Helper (Renderer).app/Contents/MacOS/LeagueClientUx Helper (Renderer) --type=renderer --no-sandbox --autoplay-policy=no-user-gesture-required --enable-viewport --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --field-trial-handle=1718379636,6221943327936792679,7564310403994520756,131072 --disable-features=CookiesWithoutSameSiteMustBeSecure,HardwareMediaKeyHandling,SameSiteByDefaultCookies --lang=en-US --framework-dir-path=/Applications/League of Legends.app/Contents/LoL/League of Legends.app/Contents/Frameworks/Chromium Embedded Framework.framework --log-file=/Users/pedrojacques/Library/Logs/LeagueClientUx_debug.log --user-agent-product=LeagueOfLegendsClient/13.5.497.3109 (CEF 91) --disable-extensions --disable-scroll-bounce --disable-spell-checking --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=7 --no-v8-untrusted-code-mitigations --shared-files --app-name=LeagueClient --ux-name=LeagueClientUx --ux-helper-name=LeagueClientUxHelper --log-dir=LeagueClient Logs --app-port=55704 --output-base-dir=/Applications/League of Legends.app/Contents/LoL --crash-reporting=crashpad --crash-environment=LA1 --app-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-24_36865_LeagueClient.log --primary-ux-log-file-path=/Applications/League of Legends.app/Contents/LoL/Logs/LeagueClient Logs/2023-03-11T13-29-29_36887_LeagueClientUx.log
grep LeagueClientUx
I believe the _url:wss://riot:fB_htNn4GqNLW8NKxPqN8A--app-port@127.0.0.1:55704
value is incorrectly parsed.
This should be fixed by the latest commit on main. Until I am able to publish the next rc I suggest you grab the dependency via git npm specifiers
The aforementioned changes are now published under 6.0.0-rc11 https://www.npmjs.com/package/league-connect?activeTab=versions
Please try the new version and if it doesn't work, re-open this, or create another issue! Thank you!