Upgraded to Next Auth v5
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import axios from 'axios'
|
||||
import { db } from "@/lib/db"
|
||||
import { NextResponse } from "next/server";
|
||||
import { GET as authorize } from '../authorize/route'
|
||||
|
||||
export async function GET(req: Request) {
|
||||
try {
|
||||
@ -11,7 +10,6 @@ export async function GET(req: Request) {
|
||||
id: req.headers.get('x-api-key') as string
|
||||
}
|
||||
})
|
||||
|
||||
if (!key) {
|
||||
return new NextResponse("Forbidden", { status: 403 });
|
||||
}
|
||||
@ -46,9 +44,6 @@ export async function GET(req: Request) {
|
||||
|
||||
// Fetch values from token.
|
||||
const { access_token, expires_in, refresh_token, token_type } = token
|
||||
// console.log("AT", access_token)
|
||||
// console.log("RT", refresh_token)
|
||||
// console.log("TT", token_type)
|
||||
|
||||
if (!access_token || !refresh_token || token_type !== "bearer") {
|
||||
return new NextResponse("Unauthorized", { status: 401 });
|
||||
|
Reference in New Issue
Block a user