feat: better way to detect initial account creation

This commit is contained in:
Deluan
2020-02-08 13:43:14 -05:00
parent 730722cfe3
commit 10ead1f5f2
5 changed files with 77 additions and 47 deletions
+1 -5
View File
@@ -56,11 +56,7 @@ const authProvider = {
checkAuth: () =>
localStorage.getItem('token') ? Promise.resolve() : Promise.reject(),
checkError: (error) => {
const { status, message } = error
if (message === 'no users created') {
localStorage.setItem('initialAccountCreation', 'true')
}
checkError: ({ status }) => {
if (status === 401 || status === 403) {
removeItems()
return Promise.reject()