feat: set login only for superadmin

main
Firman Ramdhani 2024-10-03 12:06:32 +07:00
parent 4c0719e757
commit 8ec54c467b
1 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,17 @@ export default function LoginPage() {
if (status === 201) {
const user = data?.data;
const role = user?.role;
if (role != 'superadmin') {
throw {
response: {
data: {
error: 'Unauthorized',
message: 'Gagal! username atau password tidak sesuai',
statusCode: 401,
},
},
};
}
await handleLogin(user);
if (role === 'tenant') {