1
0
Fork 0

remove debugs

refactor/models
Matthew 2019-11-17 00:24:14 -05:00
parent 8d43d4c6c5
commit d10156e2c1
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 0 additions and 3 deletions

View File

@ -45,13 +45,10 @@ export default class Security {
const saltCheck = await this.client.db.Account.findOne({ salt }); const saltCheck = await this.client.db.Account.findOne({ salt });
const encrypted = bearer.split(':')[1]; const encrypted = bearer.split(':')[1];
let decrypted = decipher.update(encrypted, 'base64', 'utf8'); let decrypted = decipher.update(encrypted, 'base64', 'utf8');
this.client.signale.debug(decrypted);
decipher.setAuthTag(saltCheck.authTag); decipher.setAuthTag(saltCheck.authTag);
decrypted += decipher.final('utf8'); decrypted += decipher.final('utf8');
const json = JSON.parse(decrypted); const json = JSON.parse(decrypted);
const account = await this.client.db.Account.findOne({ username: json.username }); const account = await this.client.db.Account.findOne({ username: json.username });
this.client.signale.debug(account);
this.client.signale.debug(saltCheck);
if (saltCheck.salt !== account.salt) return null; if (saltCheck.salt !== account.salt) return null;
return account; return account;
} catch (error) { } catch (error) {