(req, res)
| 302 | }; |
| 303 | |
| 304 | const 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 | |
| 321 | const fetchDeviceDetails = async (req, res) => { |
| 322 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected