Is there an example of an Okta integration (@okta/okta-vue": "^2.0.0") with Quasar framwork?
-
Is there an example of an Okta integration (@okta/okta-vue": “^2.0.0”) with Quasar framwork?
There are example using vuejs, but not with Quasar framework.
I seems that the right pattern wit Quasar is to create a Boot file, see https://quasar.dev/quasar-cli/cli-documentation/boot-files#Examples-of-appropriate-usage-of-boot-files.
I have started with this boot file, but reading more about It, I needed an example:
import Auth from '@okta/okta-vue'; export default async ( { router, Vue, urlPath, redirect}) => { // something to do Vue.use(Auth, { issuer: 'https://xxxxx/oauth2/default', client_id: 'yyyyyyyyy', redirect_uri: window.location.origin + '/callback', }); router.beforeEach(Vue.prototype.$auth.authRedirectGuard()); }
The “best” update hint examples for vue I suggest
https://developer.okta.com/blog/2019/05/30/vue-pwa-typescriptWhy ?
because of the installation
npm i @okta/okta-vue@2.0.0 @types/okta__okta-vue@1.2.0
I found out that you need to import okta__okta-vue@1.2.0
to manage use version 2 of “@okta/okta-vue”: “^2.0.0”,.Because
import Auth from '@okta/okta-vue';
will “fail” with this message:
TS7016: Could not find a declaration file for module '@okta/okta-vue'. ../strommaler-ui/node_modules/@okta/okta-vue/dist/okta-vue.js' implicitly has an 'any' type. Try `npm install @types/okta__okta-vue` if it exists or add a new declaration (.d.ts) file containing `declare module '@okta/okta-vue';
See fix:
Thank you!
Tore Gard
Working at https://techpros.no/new/