Hello,
I am building a login page with Quasar. I used @okta-vue for the login, but we want to use the application with SSR not client-side. the Auth.handleCallBack() is there a away to make this work at serverside or is there a way to make it work with preFetch.
I have this as code: router/routes.js
{
path: ‘/login’,
component: () => import(‘layouts/Login.vue’),
children: [
{
path: ‘’,
component: () => import(‘pages/Login.vue’)
},
{
path: ‘callback’,
component: () => import(’…/…/node_modules/@okta/okta-vue/src/components/ImplicitCallback’)
}
]
}
And I have this in my boot file:
import { axiosInstance } from 'boot/axios'
export default async ({ router, store, Vue }) => {
router.beforeEach(Vue.prototype.$auth.authRedirectGuard())
// const tokenStorage = LocalStorage.getItem('okta-token-storage')
const tokenStorage = await Vue.prototype.$auth.isAuthenticated()
axiosInstance.defaults.headers.common['Authorization'] = 'Bearer ' + tokenStorage
return store.dispatch('auth/fetchAuth', tokenStorage)
// console.log('accessToken: ', accessToken)
}