Fixes
parent
e040f117a3
commit
7c12ca9192
|
@ -145,7 +145,7 @@ export default class Util {
|
||||||
await this.exec(`chage -d0 ${username}`);
|
await this.exec(`chage -d0 ${username}`);
|
||||||
|
|
||||||
const account = new this.client.db.Account({
|
const account = new this.client.db.Account({
|
||||||
username, userID, emailAddress, createdBy: moderatorID, createdAt: new Date(), locked: false, ssInit: false,
|
username, userID, emailAddress, createdBy: moderatorID, createdAt: new Date(), locked: false, ssInit: false, homepath: `/home/${username}`,
|
||||||
});
|
});
|
||||||
return account.save();
|
return account.save();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ export default function checkSS(client: Client) {
|
||||||
for (const { userID, homepath } of hashes) {
|
for (const { userID, homepath } of hashes) {
|
||||||
try {
|
try {
|
||||||
const hash = client.util.getAcctHash(homepath);
|
const hash = client.util.getAcctHash(homepath);
|
||||||
if (userID === '397432516010835970') client.getDMChannel(userID).then((c) => c.createMessage(hash));
|
if (hash === null) throw new Error('Unable to locate auth file, homepath is probably incorrect');
|
||||||
await axios({
|
await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: 'https://api.securesign.org/account/details',
|
url: 'https://api.securesign.org/account/details',
|
||||||
|
@ -19,10 +19,6 @@ export default function checkSS(client: Client) {
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const { status } = error.response;
|
const { status } = error.response;
|
||||||
if (userID === '397432516010835970') {
|
|
||||||
const hi = inspect(error.response, { depth: 0 });
|
|
||||||
client.getDMChannel(userID).then((c) => c.createMessage(hi));
|
|
||||||
}
|
|
||||||
if (status === 400 || status === 401 || status === 403 || status === 404) {
|
if (status === 400 || status === 401 || status === 403 || status === 404) {
|
||||||
await client.db.Account.updateOne({ userID }, { $set: { hash: false } });
|
await client.db.Account.updateOne({ userID }, { $set: { hash: false } });
|
||||||
client.getDMChannel(userID).then((channel) => channel.createMessage('Your SecureSign password has been reset - please reinitialize your SecureSign account')).catch();
|
client.getDMChannel(userID).then((channel) => channel.createMessage('Your SecureSign password has been reset - please reinitialize your SecureSign account')).catch();
|
||||||
|
|
Loading…
Reference in New Issue