No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Is there an example of an Okta integration (@okta/okta-vue": "^2.0.0") with Quasar framwork?

    Framework
    1
    1
    318
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      toregard last edited by

      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-typescript

      Why ?

      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:

      • https://developer.aliyun.com/mirror/npm/package/@types/okta__okta-vue

      Thank you!

      Tore Gard
      Working at https://techpros.no/new/

      1 Reply Last reply Reply Quote 0
      • First post
        Last post