Skip to content

Commit

Permalink
Added test case for deregister
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhish-nayak committed Mar 31, 2024
1 parent cb50fd1 commit 9dd87e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/controllers/auth/deregister.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Request, Response } from "express";
export const deregister = async (req: Request, res: Response) => {
const userId = getUserIdFromCookie(req);

if (userId === 0) return res.status(401).json("Cookie not found!");

// Zod validations
const validationResult = LoginSchema.safeParse(req);
if (!validationResult.success) {
Expand Down

0 comments on commit 9dd87e0

Please sign in to comment.