fix: msg role invalid

This commit is contained in:
Alexandro Uc Santos
2024-06-17 20:05:04 -06:00
parent bb30443faa
commit a0032b26c1

View File

@@ -6,7 +6,7 @@ export const login = async(body) => {
try { try {
const endpoint = "/v1/account/authorize"; const endpoint = "/v1/account/authorize";
const {data} = await apiPublic.post(endpoint, body); const {data} = await apiPublic.post(endpoint, body);
console.log('auth: ', data); // console.log('auth: ', data);
if(data.accessToken !== null){ if(data.accessToken !== null){
if(data.user.job_role !== 'driver'){ if(data.user.job_role !== 'driver'){
return { return {
@@ -15,7 +15,10 @@ export const login = async(body) => {
}; };
} else { } else {
//Remover datos de sesion //Remover datos de sesion
return 'Rol no autorizado'; return {
msg: 'Rol no autorizado',
data: null
};
} }
} else { } else {
return { return {