Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
Something went wrong. Try again.
1234567891011121314151617181920212223242526import type { AuthOutput } from "@atproto/xrpc-server";import type express from "express";import { verifyToken } from "./verifyToken";
type ReqCtx = { req: express.Request;};
export default async function authVerifier(ctx: ReqCtx): Promise<AuthOutput> { if (!ctx.req.headers.authorization) { return {}; }
const bearer = (ctx.req.headers.authorization || "").split(" ")[1]?.trim();
if (bearer && bearer !== "null") { const credentials = await verifyToken(bearer);
return { credentials, }; }
return {};}