1
0
mirror of https://github.com/advplyr/audiobookshelf.git synced 2025-02-24 00:21:12 +01:00
audiobookshelf/client/middleware/authenticated.js
2021-08-26 18:32:05 -05:00

7 lines
241 B
JavaScript

export default function ({ store, redirect, route }) {
// If the user is not authenticated
if (!store.state.user.user) {
if (route.name === 'batch') return redirect('/login')
return redirect(`/login?redirect=${route.path}`)
}
}