20 lines
593 B
TypeScript
20 lines
593 B
TypeScript
import { verifySession } from "@/app/_lib/dal"
|
|
|
|
export async function GET() {
|
|
|
|
const session = await verifySession()
|
|
|
|
// Check if the user is authenticated
|
|
if (!session) {
|
|
// User is not authenticated
|
|
return new Response(null, { status: 401 })
|
|
}
|
|
const accessKeyId = process.env.ALIYUN_RAM_ACCESS_KEY_ID || ''
|
|
const accessKeySecret = process.env.ALIYUN_RAM_ACCESS_KEY_SECRET || ''
|
|
return Response.json({
|
|
accessKeyId: accessKeyId,
|
|
accessKeySecret: accessKeySecret,
|
|
region: 'oss-cn-hangzhou',
|
|
bucket: 'newuitab'
|
|
})
|
|
} |