mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-25 19:39:46 +01:00
Make eventStream connection/reconnection more reliable
Also more logs on the server
This commit is contained in:
parent
c8c95bfb47
commit
3e8bee4f65
4 changed files with 121 additions and 61 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import jwtDecode from 'jwt-decode'
|
||||
import md5 from 'md5-hex'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { baseUrl } from './utils'
|
||||
import config from './config'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { startEventStream, stopEventStream } from './eventStream'
|
||||
|
||||
const authProvider = {
|
||||
login: ({ username, password }) => {
|
||||
|
|
@ -38,6 +39,9 @@ const authProvider = {
|
|||
)
|
||||
// Avoid going to create admin dialog after logout/login without a refresh
|
||||
config.firstTime = false
|
||||
startEventStream().catch((e) =>
|
||||
console.log('error setting up event stream:', e)
|
||||
)
|
||||
return response
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
@ -53,6 +57,7 @@ const authProvider = {
|
|||
},
|
||||
|
||||
logout: () => {
|
||||
stopEventStream()
|
||||
removeItems()
|
||||
return Promise.resolve()
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue