Files
dancefinder-app/middleware/auth.js
T

13 lines
296 B
JavaScript

import { useAuth } from '../plugins/auth'
export default async ({ app: { router } }) => {
const onRedirectCallback = (appState) => {
router.push(
appState && appState.targetUrl
? appState.targetUrl
: window.location.pathname
)
}
useAuth(onRedirectCallback)
}