2022-08-03 18:40:05 +02:00
|
|
|
import { useAuth } from '~/plugins/auth'
|
2020-04-06 10:19:18 +02:00
|
|
|
|
2022-08-03 18:40:05 +02:00
|
|
|
export default ({ 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)
|
|
|
|
|
}
|