fix: msg role invalid
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user