fix: update dependencies to latest

This commit is contained in:
Divlo
2023-04-03 00:11:19 +02:00
parent c96385edd5
commit ae953d6c1a
38 changed files with 7885 additions and 3125 deletions

View File

@ -1,6 +1,6 @@
import axios from 'axios'
export const API_VERSION = '1.2.4'
export const API_VERSION = '1.2.5'
export const API_DEFAULT_PORT = 8080

View File

@ -2,6 +2,7 @@ import type { AxiosInstance } from 'axios'
import axios from 'axios'
import type { Socket } from 'socket.io-client'
import { io } from 'socket.io-client'
import { isUnauthorizedError } from '@thream/socketio-jwt'
import { API_URL } from '../api'
import { cookies } from '../cookies'
@ -30,7 +31,7 @@ export class Authentication {
)
})
this.socket.on('connect_error', (error) => {
if (error.message.startsWith('Unauthorized')) {
if (isUnauthorizedError(error)) {
fetchRefreshToken(this.tokens.refreshToken)
.then(({ accessToken }) => {
this.setAccessToken(accessToken)
@ -58,10 +59,7 @@ export class Authentication {
)
this.setAccessToken(accessToken)
}
config.headers = config.headers == null ? {} : config.headers
config.headers[
'Authorization'
] = `${this.tokens.type} ${this.tokens.accessToken}`
config.headers.Authorization = `${this.tokens.type} ${this.tokens.accessToken}`
return config
},
async (error) => {