add: more things

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-06 15:21:36 +08:00
parent 41e98bb602
commit 244aa607f7
71 changed files with 2998 additions and 1014 deletions
+12
View File
@@ -0,0 +1,12 @@
// utils/roleRedirect.util.js
// Single source of truth for "where does this account type land after auth."
// acc_type is only ever 'admin' | 'staff' | 'user' (see users.mdl.js) — there is
// no 'client' value, despite some older call sites checking for one.
export function getRoleHomePath(user) {
switch (user?.acc_type) {
case 'admin': return '/admin'
case 'staff': return '/staff'
case 'user': return user.needs_intro ? '/intro' : '/dashboard'
default: return '/dashboard'
}
}