mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-30 22:09:35 +02:00
fix: fix compilation
This commit is contained in:
1 parent
74d625d6d4
commit
83a9505a11
1 file changed
+3
-3
@@ -119,7 +119,7 @@ export function handleError(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getUser(req: express.Request) {
|
export async function getUser(req: express.Request) {
|
||||||
function notConnected() {
|
function notConnected(): never {
|
||||||
req.logout((error) => {
|
req.logout((error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`[ERROR] Error while logging out: ${error}`);
|
console.error(`[ERROR] Error while logging out: ${error}`);
|
||||||
@@ -131,11 +131,11 @@ export async function getUser(req: express.Request) {
|
|||||||
}
|
}
|
||||||
const user = (req.user as any).user;
|
const user = (req.user as any).user;
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return notConnected();
|
notConnected();
|
||||||
}
|
}
|
||||||
const model = await UserModel.findById(user.id);
|
const model = await UserModel.findById(user.id);
|
||||||
if (!model) {
|
if (!model) {
|
||||||
return notConnected();
|
notConnected();
|
||||||
}
|
}
|
||||||
return new User(model);
|
return new User(model);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user