feat(intial auth): intial auth setup for the scanner
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
This commit is contained in:
21
backend/mobile/mobilePin.route.ts
Normal file
21
backend/mobile/mobilePin.route.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Router } from "express";
|
||||
import { generateUniquePin } from "../utils/generateScannerPin.utils.js";
|
||||
import { apiReturn } from "../utils/returnHelper.utils.js";
|
||||
|
||||
const r = Router();
|
||||
|
||||
r.get("/new", async (_, res) => {
|
||||
const getPin = await generateUniquePin();
|
||||
|
||||
return apiReturn(res, {
|
||||
success: getPin.success,
|
||||
level: getPin.level,
|
||||
module: "mobile",
|
||||
subModule: "auth",
|
||||
message: getPin.message,
|
||||
data: getPin.data,
|
||||
status: getPin.success ? 200 : 400,
|
||||
});
|
||||
});
|
||||
|
||||
export default r;
|
||||
Reference in New Issue
Block a user