2020-06-21 17:59:14 +02:00
|
|
|
import { useAuth } from '../plugins/auth'
|
2020-04-06 10:19:18 +02:00
|
|
|
|
2020-04-06 10:52:55 +02:00
|
|
|
export default async ({ app: { router } }) => {
|
2021-11-19 21:44:36 +01:00
|
|
|
const onRedirectCallback = (appState) => {
|
2020-04-06 10:19:18 +02:00
|
|
|
router.push(
|
|
|
|
|
appState && appState.targetUrl
|
|
|
|
|
? appState.targetUrl
|
|
|
|
|
: window.location.pathname
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
useAuth(onRedirectCallback)
|
|
|
|
|
}
|