How to handle 401 (Authentication Error) in axios and react?
I got it working with following code import axios from 'axios'; import config from '../../configuration.json'; import qs from 'qs'; const baseURL = config['baseUrl_local']; let authTokenRequest; /** * @description axios instance for ajax requests */ var client = axios.create({ baseURL: baseURL, headers: { appID: 8, version: "1.1.0", empID: localStorage.getItem('empID'), token: localStorage.getItem('accessToken')
https://stackoverflow.com/questions/47216452/how-to-handle-401-authentication-error-in-axios-and-react