🎨 typo
This commit is contained in:
parent
284e159ae2
commit
251b23e321
@ -5,12 +5,12 @@ This repository contains the HTTP API Server and the WebSocket Gateway Server
|
|||||||
[Project Board](https://github.com/discord-open-source/discord-server/projects/4)
|
[Project Board](https://github.com/discord-open-source/discord-server/projects/4)
|
||||||
|
|
||||||
## API
|
## API
|
||||||
[Project Board](https://github.com/discord-open-source/discord-server/projects/3)
|
[Project Board](https://github.com/discord-open-source/discord-server/projects/6)
|
||||||
|
|
||||||
For the WebSocket we use [ws](https://www.npmjs.com/package/ws) and we'll write our own packet handler for the individual opcodes and events.
|
For the WebSocket we use [ws](https://www.npmjs.com/package/ws) and we'll write our own packet handler for the individual opcodes and events.
|
||||||
|
|
||||||
## Gateway
|
## Gateway
|
||||||
[Project Board](https://github.com/discord-open-source/discord-server/projects/6)
|
[Project Board](https://github.com/discord-open-source/discord-server/projects/3)
|
||||||
|
|
||||||
We use [express](https://expressjs.com/) for the HTTP Server and
|
We use [express](https://expressjs.com/) for the HTTP Server and
|
||||||
[lambert-server](https://www.npmjs.com/package/lambert-server) for route handling and body validation (customized).
|
[lambert-server](https://www.npmjs.com/package/lambert-server) for route handling and body validation (customized).
|
||||||
|
@ -6,7 +6,9 @@ import jwt from "jsonwebtoken";
|
|||||||
import Config from "../../../../util/Config";
|
import Config from "../../../../util/Config";
|
||||||
import { User } from "../../../../models/User";
|
import { User } from "../../../../models/User";
|
||||||
import { adjustEmail } from "./register";
|
import { adjustEmail } from "./register";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
export default router;
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
"/",
|
"/",
|
||||||
@ -21,7 +23,7 @@ router.post(
|
|||||||
async (req: Request, res: Response) => {
|
async (req: Request, res: Response) => {
|
||||||
const { login, password } = req.body;
|
const { login, password } = req.body;
|
||||||
|
|
||||||
// query for user with same email or phone number
|
// * MongoDB Specific query for user with same email or phone number
|
||||||
const userquery = { $or: [{ email: adjustEmail(login) }, { phone: login }] };
|
const userquery = { $or: [{ email: adjustEmail(login) }, { phone: login }] };
|
||||||
const user: User = await db.data
|
const user: User = await db.data
|
||||||
.users(userquery)
|
.users(userquery)
|
||||||
@ -70,8 +72,6 @@ export async function generateToken(id: bigint) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default router;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST /auth/login
|
* POST /auth/login
|
||||||
* @argument { login: "email@gmail.com", password: "cleartextpassword", undelete: false, captcha_key: null, login_source: null, gift_code_sku_id: null, }
|
* @argument { login: "email@gmail.com", password: "cleartextpassword", undelete: false, captcha_key: null, login_source: null, gift_code_sku_id: null, }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user