NextJS + Capacitor + API call with token

Hello, apologies if this has been answered before.

I have a NextJs application with Capacitor for Android/iOS applications. I followed the tutorials and have successfully managed to login using the loginWithRedirect from @auth0/auth0-react. The login redirects back to the application and is handled with handleRedirectCallback.

I’m wanting to hit an API and will need an access token but when I call getAccessTokenSilently I get a variety of errors and I’ve tried different configurations. Mainly a ‘Missing Refresh Token’ error.

I’ve read about the Authorization Code Flow with PKCE and wondering if the login needs to be replaced with this flow entirely? Using Capacitor where should the refresh_token be stored? Can capacitor storage be used?

Or am I confusing several flows?


When calling getAccessTokenSilently and inspecting the network tab I can see that a call to token is successful but then states Missing Refresh Token when catching the error.