Skip to content

Instantly share code, notes, and snippets.

xbits / axiosClient.es6.js
Last active Mar 4, 2020
Example axios client for devise_token_auth
View axiosClient.es6.js
This is an example of how to set up an axios instance to work with devise_token_auth gem.
import axios from 'axios';
// Add the token headers to every request
const addTokenHeaders = (request) => {
let tokenAuth = localStorage.tokenAuth;
if(tokenAuth) {