-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added middleware for mobile routes
- Loading branch information
1 parent
cd90055
commit a60ba45
Showing
3 changed files
with
62 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
|
||
import db from '@/db'; | ||
import { NextResponse, NextRequest } from 'next/server'; | ||
// import bcrypt from 'bcrypt'; | ||
|
||
export async function GET(req: NextRequest) { | ||
try { | ||
console.log(req); | ||
const user = { | ||
id: '1', | ||
appxUserId: '100', | ||
disableDrm: false, | ||
email: '[email protected]', | ||
password: 'fjklasjf', | ||
token: 'jfskd.fjskdf.fsdf', | ||
}; | ||
|
||
console.log(user); | ||
const user = JSON.parse(req.headers.get('g') || ''); | ||
if (!user) { | ||
return NextResponse.json({ message: 'User Not Found' }, { status: 400 }); | ||
} | ||
const userCourses = await db.course.findMany({ | ||
where: { | ||
purchasedBy: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.