DONE: add customer pages, implement auth on teller page

This commit is contained in:
ISMAIL MASSERAN
2026-07-21 10:24:14 +08:00
parent 3189e3a1e3
commit a671f7ad5c
48 changed files with 5627 additions and 273 deletions
+20
View File
@@ -0,0 +1,20 @@
import { DEVICE_TOKEN_KEY } from "./constants";
export function getDeviceToken(): string {
if (typeof window === "undefined") {
return "";
}
const existing = window.localStorage.getItem(DEVICE_TOKEN_KEY);
if (existing) {
return existing;
}
const token =
typeof crypto !== "undefined" && "randomUUID" in crypto
? crypto.randomUUID()
: `web-${Date.now()}-${Math.random().toString(36).slice(2)}`;
window.localStorage.setItem(DEVICE_TOKEN_KEY, token);
return token;
}