Browse Source

fix(gui): update refresh-token api url

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4861/head
Pranav C 2 years ago
parent
commit
ee8621b82c
  1. 4
      packages/nc-gui/composables/useApi/interceptors.ts
  2. 2
      packages/nc-gui/composables/useGlobal/actions.ts

4
packages/nc-gui/composables/useApi/interceptors.ts

@ -38,7 +38,7 @@ export function addAxiosInterceptors(api: Api<any>) {
}
// Logout user if token refresh didn't work or user is disabled
if (error.config.url === '/auth/refresh-token') {
if (error.config.url === '/auth/token/refresh') {
state.signOut()
return Promise.reject(error)
@ -46,7 +46,7 @@ export function addAxiosInterceptors(api: Api<any>) {
// Try request again with new token
return api.instance
.post('/auth/refresh-token', null, {
.post('/auth/token/refresh', null, {
withCredentials: true,
})
.then((token) => {

2
packages/nc-gui/composables/useGlobal/actions.ts

@ -29,7 +29,7 @@ export function useGlobalActions(state: State): Actions {
const t = nuxtApp.vueApp.i18n.global.t
nuxtApp.$api.instance
.post('/auth/refresh-token', null, {
.post('/auth/token/refresh', null, {
withCredentials: true,
})
.then((response) => {

Loading…
Cancel
Save