Skip to content

Commit

Permalink
refactor auth logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushtiwari110 committed Jun 20, 2024
1 parent 2a952f6 commit f136e6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/isAuthenticated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { NextRequest } from 'next/server'

export const isAuthenticated = (req: NextRequest): boolean => {
const user = req.cookies.get('uni_user_token')
return !!user?.value
}

0 comments on commit f136e6a

Please sign in to comment.