Okta-vue 3.1 this.$auth.getAccessToken(); does it return a promise or is is synchronous?

simple question:

In Okta-vue 3.1

if i call it like this, it works.


but if i put

this.$auth.getAccessToken().then((token) => { //<---------blow up here saying it’s not a function.
this.$store.commit(‘SET_ACCESS_TOKEN’, token)
localStorage.setItem(‘token’, JSON.stringify(token))
apiClient.defaults.headers.common.Authorization = Bearer ${token}

I get an error that’s it’s not a function at runtime only.

Does it return a promise or is is synchronous?

Or am I just having weird scope issues…


Doesn’t look like its supposed to return a promise, just the access token string and our documentation does not indicate this is an async function as it does for others: getAccessToken | Okta Auth Javascript SDK

I think it should return the promise as we are calling Okta(outside of vue application).