Add a way to generate invites from the command line. Add database migration script.

This commit is contained in:
knotteye
2020-10-13 15:48:39 -05:00
parent 8caad60a43
commit 9605ff8c92
4 changed files with 25 additions and 5 deletions

View File

@@ -98,9 +98,9 @@ async function getConfig(username: string, all?: boolean): Promise<object>{
return t;
}
async function genInvite(user: string): Promise<string>{
async function genInvite(): Promise<string>{
var invitecode: string = base64id.generateId();
await db.query('INSERT INTO invites (code) VALUES ('+invitecode+')');
await db.query('INSERT INTO invites (code) VALUES (\"'+invitecode+'\")');
return invitecode;
}