Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Aug 22, 2023
1 parent 7085b26 commit b1996e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion express/backend/src/api/user.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { request } from "@octokit/request";
import { json, Request, Router } from "express";
import { OptionalId } from "mongodb";
import NodeCache from "node-cache";
import Cookies from "universal-cookie";
import cookiesMiddleware from "universal-cookie-express";
import { COOKIE_NAME_PORTAL_TOKEN } from "../auth";
import { dbConnect } from "../db/utils";
import { User } from "../global/user";

const router = Router();

Expand Down Expand Up @@ -50,7 +52,7 @@ router.get("/api/user/", cookiesMiddleware(), async function (req, res) {
return;
}

let user = await users.findOne({ login });
let user = await users.findOne({ login }) as OptionalId<User>;
if (!user) {
user = {
login,
Expand Down

0 comments on commit b1996e3

Please sign in to comment.