import { Request, Response } from "express";
import Stacker from "../middlewares/stacker";
import { GetUserMiddleware } from "../middlewares/user";
import LoginToken, { CheckToken } from "../../models/login_token";
import RequestError, { HttpStatusCode } from "../../helper/request_error";

export const GetAccount = Stacker(
   GetUserMiddleware(true, true),
   async (req: Request, res: Response) => {
      let user = {
         id: req.user.uid,
         name: req.user.name,
         username: req.user.username,
         birthday: req.user.birthday,
         gender: req.user.gender,
      };
      res.json({ user });
   }
);
