Fix jwt-token
This commit is contained in:
@@ -115,7 +115,7 @@ export const AuthProvider = ({ children }) => {
|
|||||||
const login = async (credentials) => {
|
const login = async (credentials) => {
|
||||||
try {
|
try {
|
||||||
dispatch({ type: 'LOGIN_START' });
|
dispatch({ type: 'LOGIN_START' });
|
||||||
const response = await api.post('/users/login', credentials);
|
const response = await api.post('/auth/local', credentials);
|
||||||
|
|
||||||
const { user, token } = response.data.data;
|
const { user, token } = response.data.data;
|
||||||
localStorage.setItem('token', token);
|
localStorage.setItem('token', token);
|
||||||
|
|||||||
Reference in New Issue
Block a user