Skip to content

Commit ddb663d

Browse files
alanbixbysuufiNeztore
authored
Fix overloaded jar in CSRF and wss based methods (#419)
* Simplify jar overloading by permitting strings * Make getCurrentUser() options case-insensitive * Fix overloaded jar in CSRF and wss based methods * Trigger Build Co-authored-by: suufi <12759332+suufi@users.noreply.github.com> Co-authored-by: Neztore <hi@nezto.re>
1 parent ef5377e commit ddb663d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

lib/user/onNotification.js

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ exports.func = function (args) {
2727
const max = settings.event.maxRetries
2828
const notifications = new events.EventEmitter()
2929
function connect (retries) {
30+
if (typeof args.jar === 'string') {
31+
args.jar = { session: args.jar }
32+
}
3033
const session = getSession({ jar: args.jar })
3134
const client = new SignalR('wss://realtime.roblox.com/notifications', ['usernotificationhub'], 3, true) // wss for https
3235
client.headers.Cookie = '.ROBLOSECURITY=' + session + ';'

lib/util/getHash.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ exports.optional = ['jar']
2020
**/
2121

2222
// Define
23-
exports.func = function (args) {
24-
const session = getSession({ jar: args.jar })
23+
exports.func = function ({ jar }) {
24+
if (typeof jar === 'string') {
25+
jar = { session: jar }
26+
}
27+
const session = getSession({ jar })
2528
return crypto.createHash('md5').update(session).digest('hex')
2629
}

lib/util/getSession.js

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ exports.optional = ['jar']
2121
exports.func = function (args) {
2222
const jar = args.jar || options.jar
2323
if (settings.session_only) {
24+
if (typeof jar === 'string') {
25+
return jar
26+
}
2427
return jar.session
2528
} else {
2629
const cookies = jar.getCookies('https://roblox.com')

0 commit comments

Comments
 (0)