Allow bearer auth for admin API
This commit is contained in:
1 parent
142e34babe
commit
fb99058492
14 files changed
+47
-28
No files matched your search
@@ -3,7 +3,7 @@ import { Genre } from "../../models/genre"
|
||||
import { defineAuthenticatedEventHandler, requireAuthenticatedUser } from "../../utils/auth"
|
||||
|
||||
export default defineAuthenticatedEventHandler(async (event) => {
|
||||
await requireAuthenticatedUser(event, true)
|
||||
await requireAuthenticatedUser(event, true, { allowBearer: true, skipOriginCheck: true })
|
||||
|
||||
const body = await readBody<unknown>(event)
|
||||
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
||||
|
||||
Reference in new issue
Block a user