mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2026-01-25 06:04:05 +00:00
bugfixes, improving API request wrapper
This commit is contained in:
5
index.ts
5
index.ts
@@ -91,7 +91,10 @@ app.use("/health", (_req, res) => {
|
||||
});
|
||||
app.use("/auth-health", isAuthenticated, async (req, res) => {
|
||||
try {
|
||||
const respData = await getCurrentUsersProfile({ req, res });
|
||||
const { authHeaders } = req.session;
|
||||
if (!authHeaders)
|
||||
throw new ReferenceError("session does not have auth headers");
|
||||
const respData = await getCurrentUsersProfile({ authHeaders, res });
|
||||
if (!respData) return null;
|
||||
res.status(200).send({ message: "OK" });
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user