added email verification
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
import { ExtendedError, Server, Socket } from "socket.io";
|
||||
import { prisma } from "@repo/db";
|
||||
if (!process.env.DISPATCH_APP_TOKEN)
|
||||
throw new Error("DISPATCH_APP_TOKEN is not defined");
|
||||
if (!process.env.DISPATCH_APP_TOKEN) throw new Error("DISPATCH_APP_TOKEN is not defined");
|
||||
|
||||
export const jwtMiddleware = async (
|
||||
socket: Socket,
|
||||
next: (err?: ExtendedError) => void,
|
||||
) => {
|
||||
export const jwtMiddleware = async (socket: Socket, next: (err?: ExtendedError) => void) => {
|
||||
try {
|
||||
const { uid } = socket.handshake.auth;
|
||||
if (!uid) return new Error("Authentication error");
|
||||
|
||||
Reference in New Issue
Block a user