This commit is contained in:
parent
717e0930b2
commit
69a0a15f2d
|
@ -107,6 +107,7 @@ export async function createWordlistDatabase(uuid: T.UUID): Promise<{ name: T.Wo
|
||||||
const password = generateWordlistDbPassword();
|
const password = generateWordlistDbPassword();
|
||||||
const name = getWordlistDbName(uuid);
|
const name = getWordlistDbName(uuid);
|
||||||
// create wordlist database for user
|
// create wordlist database for user
|
||||||
|
console.log("creating db for", uuid);
|
||||||
await nano.db.create(name);
|
await nano.db.create(name);
|
||||||
const securityInfo = {
|
const securityInfo = {
|
||||||
admins: {
|
admins: {
|
||||||
|
|
|
@ -96,7 +96,6 @@ apiRouter.put("/user/upgrade", async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const givenPassword = (req.body.password || "") as string;
|
const givenPassword = (req.body.password || "") as string;
|
||||||
const studentPassword = env.upgradePassword;
|
const studentPassword = env.upgradePassword;
|
||||||
console.log("comparing", givenPassword.toLocaleLowerCase().trim(), "to", studentPassword.toLowerCase());
|
|
||||||
if (givenPassword.toLowerCase().trim() !== studentPassword.toLowerCase()) {
|
if (givenPassword.toLowerCase().trim() !== studentPassword.toLowerCase()) {
|
||||||
const wrongPass: T.UpgradeUserResponse = {
|
const wrongPass: T.UpgradeUserResponse = {
|
||||||
ok: false,
|
ok: false,
|
||||||
|
|
|
@ -31,7 +31,6 @@ export async function publishDictionary(): Promise<FT.PublishDictionaryResponse>
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function upgradeAccount(password: string): Promise<AT.UpgradeUserResponse> {
|
export async function upgradeAccount(password: string): Promise<AT.UpgradeUserResponse> {
|
||||||
|
|
||||||
const response = await accountApiFetch("user/upgrade", "PUT", { password });
|
const response = await accountApiFetch("user/upgrade", "PUT", { password });
|
||||||
return response as AT.UpgradeUserResponse;
|
return response as AT.UpgradeUserResponse;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue