mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-09 11:48:41 +01:00
fix: address review feedback on authProvider
Remove unused vi import from test file. Use Number() || 0 instead of parseInt with string fallback to handle corrupted sessionStorage values that would produce NaN.
This commit is contained in:
parent
d6c5d2487c
commit
e329667ab0
2 changed files with 3 additions and 5 deletions
|
|
@ -87,10 +87,8 @@ const authProvider = {
|
|||
}
|
||||
if (config.extAuthLogoutURL && isNetworkError(error)) {
|
||||
const now = Date.now()
|
||||
const lastReload = parseInt(
|
||||
sessionStorage.getItem('ext-auth-reload-ts') || '0',
|
||||
10,
|
||||
)
|
||||
const lastReload =
|
||||
Number(sessionStorage.getItem('ext-auth-reload-ts')) || 0
|
||||
if (now - lastReload > 30000) {
|
||||
sessionStorage.setItem('ext-auth-reload-ts', String(now))
|
||||
removeItems()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { describe, it, beforeEach, afterEach, vi, expect } from 'vitest'
|
||||
import { describe, it, beforeEach, afterEach, expect } from 'vitest'
|
||||
import config from './config'
|
||||
import authProvider from './authProvider'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue