Skip to content

Instantly share code, notes, and snippets.

@NiltonMorais
Created May 31, 2019 17:42
Show Gist options
  • Select an option

  • Save NiltonMorais/a08b54e570eb452d61190924fe7df6c5 to your computer and use it in GitHub Desktop.

Select an option

Save NiltonMorais/a08b54e570eb452d61190924fe7df6c5 to your computer and use it in GitHub Desktop.
import JwtToken from '../services/jwt-token';
axios.interceptors.response.use(response => {
if (response.headers.authorization !== undefined) {
let token = response.headers.authorization;
token = token.split(' ')[1];
JwtToken.setToken(token);
}
return response;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment