# Okta-vue.js 2 to 3 conversion, lost local session

**URL:** <https://devforum.okta.com/t/okta-vue-js-2-to-3-conversion-lost-local-session/18509>\
**Category:** Questions\
**Tags:** vue\
**Created:** [December 13, 2021, 7:12pm UTC](https://devforum.okta.com/t/okta-vue-js-2-to-3-conversion-lost-local-session/18509 "2021-12-13T19:12:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericbrown](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@ericbrown](https://devforum.okta.com/u/ericbrown)\
**Post date:** [December 13, 2021, 7:12pm UTC](https://devforum.okta.com/t/okta-vue-js-2-to-3-conversion-lost-local-session/18509/1 "2021-12-13T19:12:55Z")

</div>

I converted my okta code from v2 to v3 a while back to fix a weird bug.

my def in router /index.js looks like this now, getting the values from env files at compile time

// okta-vue 3.1 way - EWB  
const oktaAuth = new OktaAuth({  
issuer: process.env.VUE\_APP\_issuer,  
clientId: process.env.VUE\_APP\_client\_id,  
redirectUri: `${window.location.origin}/callback`,  
scopes: [‘openid’, ‘profile’, ‘email’],  
})

In vue 2 I also had at the bottom of this definiton:

tokenManager: { storage: ‘sessionStorage’ },

It was added such that closing the browser logged the user off.

but if I add it now in 3, it breaks login.

Does anyone know the formatting of the syntax in vue 3 now? I remember having to convert it to okta-vue.js 2 syntax back in the day, but i cant’ find the 3 syntax now.

Thanks,

Eric-

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 8, 2024, 9:06pm UTC](https://devforum.okta.com/t/okta-vue-js-2-to-3-conversion-lost-local-session/18509/2 "2024-02-08T21:06:01Z")

</div>


