Skip to content

Commit

Permalink
chore: Migrate the actions file
Browse files Browse the repository at this point in the history
Signed-off-by: Grigory V <[email protected]>
  • Loading branch information
GVodyanov committed Sep 16, 2024
1 parent 8af1477 commit b8e63c1
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 396 deletions.
7 changes: 5 additions & 2 deletions src/http/sessionExpiryHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
*/

import logger from '../logger.js'
import useMainStore from '../store/mainStore.js'

export async function handleHttpAuthErrors(commit, cb) {
export async function handleHttpAuthErrors(cb) {
let mainStore = useMainStore()

Check failure on line 10 in src/http/sessionExpiryHandler.js

View workflow job for this annotation

GitHub Actions / NPM lint

'mainStore' is never reassigned. Use 'const' instead

Check failure on line 11 in src/http/sessionExpiryHandler.js

View workflow job for this annotation

GitHub Actions / NPM lint

Trailing spaces not allowed
try {
return await cb()
} catch (error) {
logger.debug('req err', { error, status: error.response?.status, message: error.response?.data?.message })
if (error.response?.status === 401 && error.response?.data?.message === 'Current user is not logged in') {
logger.warn('Request failed due to expired session')
commit('setSessionExpired')
mainStore.setSessionExpiredMutation()
}
throw error
}
Expand Down
Loading

0 comments on commit b8e63c1

Please sign in to comment.