From a283d70b83200f1cc112cb3058843dd5829ae5dc Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Wed, 10 Feb 2021 14:16:30 +0100 Subject: [PATCH] update imports for fosscord-server-util --- src/Server.ts | 2 +- src/middlewares/Authentication.ts | 2 +- src/middlewares/GlobalRateLimit.ts | 2 +- src/middlewares/RateLimit.ts | 2 +- src/routes/api/v8/auth/register.ts | 1 + src/test/mongo_test.ts | 2 +- src/util/Config.ts | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Server.ts b/src/Server.ts index d427b964..b561f94e 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -3,7 +3,7 @@ import fs from "fs/promises"; import { Server, ServerOptions } from "lambert-server"; import { Authentication, GlobalRateLimit } from "./middlewares/"; import Config from "./util/Config"; -import { db } from "discord-server-util"; +import { db } from "fosscord-server-util"; import i18next from "i18next"; import i18nextMiddleware, { I18next } from "i18next-http-middleware"; import i18nextBackend from "i18next-node-fs-backend"; diff --git a/src/middlewares/Authentication.ts b/src/middlewares/Authentication.ts index 979c954a..d6eb5796 100644 --- a/src/middlewares/Authentication.ts +++ b/src/middlewares/Authentication.ts @@ -1,6 +1,6 @@ import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; -import { checkToken } from "discord-server-util"; +import { checkToken } from "fosscord-server-util"; export const NO_AUTHORIZATION_ROUTES = ["/api/v8/auth/login", "/api/v8/auth/register"]; diff --git a/src/middlewares/GlobalRateLimit.ts b/src/middlewares/GlobalRateLimit.ts index 121616f8..3d2d9d1b 100644 --- a/src/middlewares/GlobalRateLimit.ts +++ b/src/middlewares/GlobalRateLimit.ts @@ -1,6 +1,6 @@ import { NextFunction, Request, Response } from "express"; import Config from "../util/Config"; -import { db } from "discord-server-util"; +import { db } from "fosscord-server-util"; export async function GlobalRateLimit(req: Request, res: Response, next: NextFunction) { if (!Config.get().limits.rate.ip.enabled) return next(); diff --git a/src/middlewares/RateLimit.ts b/src/middlewares/RateLimit.ts index 33ae0cd5..c42d773c 100644 --- a/src/middlewares/RateLimit.ts +++ b/src/middlewares/RateLimit.ts @@ -1,5 +1,5 @@ import { NextFunction, Request, Response } from "express"; -import { db } from "discord-server-util"; +import { db } from "fosscord-server-util"; import { getIpAdress } from "./GlobalRateLimit"; diff --git a/src/routes/api/v8/auth/register.ts b/src/routes/api/v8/auth/register.ts index 0ef55b96..1250b689 100644 --- a/src/routes/api/v8/auth/register.ts +++ b/src/routes/api/v8/auth/register.ts @@ -177,6 +177,7 @@ router.post( email: adjusted_email, flags: 0n, // TODO: generate default flags hash: adjusted_password, + guilds: [], valid_tokens_since: Date.now(), user_settings: { afk_timeout: 300, diff --git a/src/test/mongo_test.ts b/src/test/mongo_test.ts index b3fadf5a..b2cc2bce 100644 --- a/src/test/mongo_test.ts +++ b/src/test/mongo_test.ts @@ -1,6 +1,6 @@ import mongoose from "mongoose"; import { Long } from "mongodb"; -import { Snowflake } from "discord-server-util"; +import { Snowflake } from "fosscord-server-util"; async function main() { const conn = await mongoose.createConnection( diff --git a/src/util/Config.ts b/src/util/Config.ts index be0f4a3b..e2625aff 100644 --- a/src/util/Config.ts +++ b/src/util/Config.ts @@ -1,4 +1,4 @@ -import { Config } from "discord-server-util"; +import { Config } from "fosscord-server-util"; import crypto from "crypto"; import fs from "fs";