Resolve tech login issue.
This commit is contained in:
@@ -323,7 +323,7 @@ export function JobLinesComponent({
|
||||
</Button>
|
||||
<Button
|
||||
disabled={
|
||||
!job.converted ||
|
||||
(job && !job.converted) ||
|
||||
(selectedLines.length > 0 ? false : true) ||
|
||||
jobRO
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import axios from "axios";
|
||||
import { all, call, put, select, takeLatest } from "redux-saga/effects";
|
||||
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { selectBodyshop } from "../user/user.selectors";
|
||||
import { techLoginFailure, techLoginSuccess } from "./tech.actions";
|
||||
import TechActionTypes from "./tech.types";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
export function* onSignInStart() {
|
||||
yield takeLatest(TechActionTypes.TECH_LOGIN_START, signInStart);
|
||||
@@ -13,11 +13,20 @@ export function* signInStart({ payload: { employeeid, pin } }) {
|
||||
logImEXEvent("redux_tech_sign_in");
|
||||
|
||||
const bodyshop = yield select(selectBodyshop);
|
||||
const response = yield call(axios.post, "/tech/login", {
|
||||
shopid: bodyshop.id,
|
||||
employeeid: employeeid,
|
||||
pin: pin,
|
||||
});
|
||||
const response = yield call(
|
||||
axios.post,
|
||||
"/tech/login",
|
||||
{
|
||||
shopid: bodyshop.id,
|
||||
employeeid: employeeid,
|
||||
pin: pin,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${yield auth.currentUser.getIdToken()}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const { valid, technician, error } = response.data;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
}
|
||||
|
||||
console.log("Axios interceptor called.");
|
||||
return config;
|
||||
},
|
||||
(error) => Promise.reject(error)
|
||||
|
||||
Reference in New Issue
Block a user