# Refreshing token with short expire time on a SPA

**URL:** <https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328>\
**Category:** Get Help\
**Tags:** spa, tier1, vuejs, jwt, refresh-tokens\
**Created:** [April 23, 2017, 8:18pm UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328 "2017-04-23T20:18:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [April 23, 2017, 8:18pm UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328/1 "2017-04-23T20:18:54Z")

</div>

I am working on a SPA project where i would like to have very short expiration (15min) and ability to refresh these. I will be utilizing VueJS so it would be beneficial to do the refreshing behind the scenes. Since it is a SPA i cannot use refresh\_tokens. Whats my options in this case?

---

<div class="post-metadata">

**Author:** ![bragma](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bragma/32/13310_2.png) [@bragma](https://community.auth0.com/u/bragma)\
**Post date:** [April 28, 2017, 4:23am UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328/2 "2017-04-28T04:23:58Z")

</div>

You can try with implicit flow, and then renewAuth using auth0’s web sdk. This will renew your token on an iframe and works without using a refresh token. The drawback is that you need to use a login page hosted on auth0 and since this will require a redirect it will not be so nice for a SPA.

---

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [April 28, 2017, 4:25am UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328/3 "2017-04-28T04:25:39Z")

</div>

I took basis in [The Complete Guide to Vue.js User Authentication with Auth0](https://auth0.com/blog/vuejs2-authentication-tutorial/) but unfortunately it also redirects to the lock10 which is not a super nice solution…

---

<div class="post-metadata">

**Author:** ![hagen.dittmer](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hagen.dittmer](https://community.auth0.com/u/hagen.dittmer)\
**Post date:** [December 22, 2017, 10:44pm UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328/4 "2017-12-22T22:44:01Z")

</div>

@maziar did you find a solution to this? I have SPA too, and I don’t want to redirect anywhere.

---

<div class="post-metadata">

**Author:** ![hagen.dittmer](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hagen.dittmer](https://community.auth0.com/u/hagen.dittmer)\
**Post date:** [December 22, 2017, 10:44pm UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328/5 "2017-12-22T22:44:01Z")

</div>

@maziar did you find a solution to this? I have SPA too, and I don’t want to redirect anywhere.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/refreshing-token-with-short-expire-time-on-a-spa/6328/6 "2018-03-02T05:53:26Z")

</div>


