Merge pull request #1966 from thelounge/xpaw/no-session-convert

Remove session token hash conversion
This commit is contained in:
Pavel Djundik 2018-02-19 19:33:42 +02:00 committed by GitHub
commit 0d068f34a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,27 +90,6 @@ function Client(manager, name, config = {}) {
if (typeof client.config.sessions !== "object") {
client.config.sessions = {};
} else {
// TODO: This is just for backwards compatibility. Remove in v3.0.0
const newSessions = {};
let changed = false;
_.forOwn(client.config.sessions, (session, key) => {
if (key.length !== 128) {
key = client.calculateTokenHash(key);
changed = true;
}
newSessions[key] = session;
});
if (changed) {
log.info(`User ${colors.bold(client.name)} has been updated with new security requirements for tokens.`);
delete client.config.token;
client.config.sessions = newSessions;
client.save();
}
}
_.forOwn(client.config.sessions, (session) => {