mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
auth middleware
This commit is contained in:
parent
3982b894d7
commit
4f86847e59
3 changed files with 9 additions and 1 deletions
|
@ -1,5 +1,12 @@
|
|||
import axios from 'axios';
|
||||
import { API } from "$constants/api";
|
||||
import { store } from '$redux/store';
|
||||
import { push } from "connected-react-router";
|
||||
|
||||
export const authMiddleware = r => {
|
||||
store.dispatch(push('/login'));
|
||||
return r;
|
||||
};
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: API.BASE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue