audiobookshelf/client/middleware/authenticated.js
2021-08-23 19:37:40 -05:00

6 lines
183 B
JavaScript

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