Files
github-stats-extended/apps/backend/api-renamed/authenticate.js
T
Marco Pasqualettiandmartin-mfg 8c065b473f feat: setup monorepo using pnpm (#20)
* tests: fix float problems and PAT problem

* extend CONTRIBUTING.md

* extend build documentation, add GH action, fix build on MacOS

* fix build on Vercel

* update .gitignore and CONTRIBUTING.md

* feat: begin work on monorepo

* chore(actions/basic-build): use pnpm

* fix: vercel-deploy

* docs: updates with new folders

* chore: apply PR review comments

---------

Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
2026-01-19 14:11:58 +01:00

22 lines
539 B
JavaScript

import { logger } from "../src/common/log.js";
import { authenticate } from "../src/users.js";
/**
* @param {any} req The request.
* @param {any} res The response.
*/
export default async (req, res) => {
const { code, private_access, user_key } = req.query;
try {
let { userId, needDowngrade } = await authenticate(
code,
private_access === "true",
user_key,
);
res.send({ userId, needDowngrade });
} catch (err) {
logger.error(err);
res.send("Something went wrong: " + err.message);
}
};