MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / fetchUserDeviceInfo

Function fetchUserDeviceInfo

controllers/auth.js:304–319  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

302};
303
304const fetchUserDeviceInfo = async (req, res) => {
305 try {
306 const { device_id: deviceId } = req.query;
307 const userDeviceInfoData = await QrCodeAuthModel.retrieveUserDeviceInfo({ deviceId });
308 if (!userDeviceInfoData.userExists) {
309 return res.boom.notFound(`User with id ${deviceId} does not exist.`);
310 }
311 return res.json({
312 message: "Authentication document retrieved successfully.",
313 data: { ...userDeviceInfoData.data },
314 });
315 } catch (error) {
316 logger.error(`Error while fetching user: ${error}`);
317 return res.boom.badImplementation(SOMETHING_WENT_WRONG);
318 }
319};
320
321const fetchDeviceDetails = async (req, res) => {
322 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected