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

Function updateStatus

models/qrCodeAuth.js:11–37  ·  view source on GitHub ↗
(userId, authStatus = "NOT_INIT", token)

Source from the content-addressed store, hash-verified

9 */
10
11const updateStatus = async (userId, authStatus = "NOT_INIT", token) => {
12 try {
13 const authData = await QrCodeAuthModel.doc(userId).get();
14
15 if (!authData.data()) {
16 return {
17 userExists: false,
18 };
19 }
20
21 await QrCodeAuthModel.doc(userId).set({
22 ...authData.data(),
23 authorization_status: authStatus,
24 token: `${token}`,
25 });
26 return {
27 userExists: true,
28 data: {
29 ...authData.data(),
30 authorization_status: authStatus,
31 },
32 };
33 } catch (err) {
34 logger.error("Error in updating auth status", err);
35 throw err;
36 }
37};
38
39const storeUserDeviceInfo = async (userDeviceInfoData) => {
40 try {

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected