SpaceNinjaServer/src/controllers/custom/getNameController.ts
Sainan d7e3f33ecf feat: add custom getName endpoint (#1108)
This can be useful for an IRC server to validate the accountId & nonce given and ensure the nickname matches.

Reviewed-on: OpenWF/SpaceNinjaServer#1108
Co-authored-by: Sainan <sainan@calamity.inc>
Co-committed-by: Sainan <sainan@calamity.inc>
2025-03-08 04:34:14 -08:00

8 lines
273 B
TypeScript

import { RequestHandler } from "express";
import { getAccountForRequest } from "@/src/services/loginService";
export const getNameController: RequestHandler = async (req, res) => {
const account = await getAccountForRequest(req);
res.json(account.DisplayName);
};