mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -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'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user