I’m trying to get Okta to work using Ionic and Vue 3 composition API.
In main.ts
import { OktaAuth } from '@okta/okta-auth-js';
import OktaVue from '@okta/okta-vue';
import oktaConfig from '@/oktaConfig';
const oktaAuth = new OktaAuth(oktaConfig.oidc)
const app = createApp(App)
.use(IonicVue)
.use(router)
.use(OktaVue, { oktaAuth });
And in App.vue the sidebar menu will have a login button.
<ion-button v-else @click="login">Login</ion-button>
setup() {
const login = async () =>{
await OktaAuth.signInWithRedirect({ originalUri: "/" });
}
}
I’m struggling with figuring out how to import okta here to get the “signInWithRedirect” to work.