fix: update dependencies to latest
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
import axios from 'axios'
|
||||
|
||||
export const API_VERSION = '1.2.3'
|
||||
export const API_VERSION = '1.2.4'
|
||||
|
||||
export const API_DEFAULT_PORT = 8080
|
||||
|
||||
export const API_URL =
|
||||
process.env.NEXT_PUBLIC_API_URL != null
|
||||
? process.env.NEXT_PUBLIC_API_URL
|
||||
process.env['NEXT_PUBLIC_API_URL'] != null
|
||||
? process.env['NEXT_PUBLIC_API_URL']
|
||||
: `http://127.0.0.1:${API_DEFAULT_PORT}`
|
||||
|
||||
export const api = axios.create({
|
||||
|
@ -59,7 +59,9 @@ 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) => {
|
||||
@ -96,7 +98,7 @@ export class Authentication {
|
||||
this.accessTokenAge = Date.now()
|
||||
const token = `${this.tokens.type} ${this.tokens.accessToken}`
|
||||
if (typeof this?.socket?.auth !== 'function' && this.socket != null) {
|
||||
this.socket.auth.token = token
|
||||
this.socket.auth['token'] = token
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user