fixing verify token redirect

This commit is contained in:
2026-01-08 14:17:11 +07:00
parent 026a88a9a9
commit 747a96ac30
3 changed files with 10 additions and 5 deletions

View File

@@ -15,7 +15,8 @@ const verifyAccess = (minLevel = 1, allowUnapprovedReadOnly = false) => {
// Super Admin bypass semua
if (user.is_sa) return next();
if (!isPhoneNumberID(user.user_id)) {
if (!isPhoneNumberID(user.user_id) && user.user_id) {
const fullUser = await getUserByIdDb(user.user_id);
if (!fullUser) throw new ErrorHandler(403, "Forbidden: User not found");