SpaceNinjaServer/src/controllers/custom/getNameController.ts
Sainan d7e3f33ecf
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (20) (push) Has been cancelled
Build / build (18) (push) Has been cancelled
Build / build (22) (push) Has been cancelled
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: #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);
};