mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
Merge pull request #1966 from thelounge/xpaw/no-session-convert
Remove session token hash conversion
This commit is contained in:
commit
0d068f34a8
1 changed files with 0 additions and 21 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue