location update optimized with schema changes and geoJson Compatability testing endpoint with encrypted key authorization

This commit is contained in:
Shibi Chakkaravarthy
2026-04-17 14:15:11 +05:30
parent b44abf9c88
commit 92769cfd38
19 changed files with 459 additions and 27 deletions
+10 -4
View File
@@ -4,6 +4,7 @@ import dayjs from "dayjs";
import {
getAccessToken,
getRefreshToken,
getEncryptedPayload,
} from "../middlewares/jwt.middleware.js";
export const createUserController = async (req, res, next) => {
@@ -45,14 +46,20 @@ export const loginController = async (req, res, next) => {
}
const accessToken = getAccessToken({ id: userExists._id });
const encryptedKey = getEncryptedPayload({ id: userExists._id });
const refreshToken = getRefreshToken();
userExists.refreshToken = refreshToken;
await userExists.save();
res
.status(200)
.json({ result: { accessToken, refreshToken, name: userExists?.name } });
res.status(200).json({
result: {
accessToken,
refreshToken,
encryptedKey,
name: userExists?.name,
},
});
} catch (error) {
console.log("loginController Error", error);
next(error);
@@ -73,4 +80,3 @@ export const renewAccessTokenController = async (req, res, next) => {
next(error);
}
};