# Refetch access token after callback

**URL:** <https://community.auth0.com/t/refetch-access-token-after-callback/120327>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, auth0-react\
**Created:** [November 6, 2023, 3:44pm UTC](https://community.auth0.com/t/refetch-access-token-after-callback/120327 "2023-11-06T15:44:53Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 13, 2023, 6:20pm UTC](https://community.auth0.com/t/refetch-access-token-after-callback/120327/7 "2023-11-13T18:20:29Z")

</div>

Could you do something like this:

> [@How to get token from outside React components?](https://community.auth0.com/t/how-to-get-token-from-outside-react-components/68756/3):
>
> Create a Interceptor class, init and export a instance class AuthInterceptor { setAuthGetter(getToken) { this.getToken = getToken; } async intercept(config) { if (!this.getToken) { return config; } try { const token = await this.getToken(); config.headers['Authorization'] = `Bearer ${token}`; } catch (e) { console.log(e); } return config; } } export const authInterceptor = new AuthInterceptor() fetchClient.interceptors.request.use(a…

---

_[View the full topic](https://community.auth0.com/t/refetch-access-token-after-callback/120327)._
