How to get a new access token after Expiring current access token in salesforce React-native?

62 views Asked by At

I am developing a hybrid app using Salesforce react-native. When the access token expires I must handle the re-login process. I want to get a new access token after it expires the current access token without the user logout and re-login.

I have used the below code to get current user data and it returns current user data

import { oauth } from "react-native-force";

oauth.getAuthCredentials(
          (res) => resolve(res),
          async (e) => {
            reject(e);
          }
        );

but when I called the below code to get a new access token after it expires in the Android app, it returned a new access token but the IOS app logout from the oauth.

 oauth.authenticate(
          (res) => resolve(res),
          async (e) => {
               reject(e);
          }
        );

I need to get a new access token after expire current access token. When the access token expires I must handle the re-login process. I want to get a new access token after it expires the current access token without the user logout and re-login.

0

There are 0 answers