Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

bugfixed

Blue Mouse6af4c2754725
diff --git a/src/actions/auth/index.js b/src/actions/auth/index.js
index 7c5a72d3e..82a85ce22 100644
--- a/src/actions/auth/index.js
+++ b/src/actions/auth/index.js
@@ -1,3 +1,4 @@
+import { removeItem } from 'utils/localstorage'
import { types } from './types'
export const authActions = {
@@ -30,8 +31,8 @@ export const authActions = {
},
logout() {
- localStorage.removeItem('access_token')
- localStorage.removeItem('user_info')
+ removeItem('access_token')
+ removeItem('user_info')
return {
type: types.LOGOUT
@@ -52,8 +53,8 @@ export const authActions = {
},
deleteAccountSuccess() {
- localStorage.removeItem('access_token')
- localStorage.removeItem('user_info')
+ removeItem('access_token')
+ removeItem('user_info')
return {
type: types.DELETE_ACCOUNT_SUCCESS
diff --git a/src/api/index.js b/src/api/index.js
index 8fd68e31a..ea557ad2f 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -41,7 +41,7 @@ export const authMe = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const login = (credentials) =>
@@ -50,7 +50,7 @@ export const login = (credentials) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const signup = (data) =>
@@ -91,7 +91,7 @@ export const forgotPassword = (email) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const confirmEmail = () =>
@@ -100,7 +100,7 @@ export const confirmEmail = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const exportUserData = () =>
@@ -109,7 +109,7 @@ export const exportUserData = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const createNewPassword = (id, password) =>
@@ -130,7 +130,7 @@ export const verifyEmail = ({ path, id }) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const getProjects = () =>
@@ -139,7 +139,7 @@ export const getProjects = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const createProject = (data) =>
@@ -148,7 +148,7 @@ export const createProject = (data) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const updateProject = (id, data) =>
@@ -157,7 +157,7 @@ export const updateProject = (id, data) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
export const deleteProject = (id) =>
@@ -166,5 +166,5 @@ export const deleteProject = (id) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- return error.response.data
+ throw error.response.data
})
\ No newline at end of file