Simplify EventStream handling
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import jwtDecode from 'jwt-decode'
|
||||
import { baseUrl } from './utils'
|
||||
import config from './config'
|
||||
import { startEventStream, stopEventStream } from './eventStream'
|
||||
|
||||
// config sent from server may contain authentication info, for example when the user is authenticated
|
||||
// by a reverse proxy request header
|
||||
@@ -48,9 +47,6 @@ const authProvider = {
|
||||
storeAuthenticationInfo(response)
|
||||
// Avoid "going to create admin" dialog after logout/login without a refresh
|
||||
config.firstTime = false
|
||||
if (config.devActivityPanel) {
|
||||
startEventStream()
|
||||
}
|
||||
return response
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -66,7 +62,6 @@ const authProvider = {
|
||||
},
|
||||
|
||||
logout: () => {
|
||||
stopEventStream()
|
||||
removeItems()
|
||||
return Promise.resolve()
|
||||
},
|
||||
@@ -90,11 +85,11 @@ const authProvider = {
|
||||
},
|
||||
|
||||
getIdentity: () => {
|
||||
return {
|
||||
return Promise.resolve({
|
||||
id: localStorage.getItem('username'),
|
||||
fullName: localStorage.getItem('name'),
|
||||
avatar: localStorage.getItem('avatar'),
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user