Attempted to call AuthSession.startAsync multiple times while already active. Only one AuthSession can be active at any given time.

  1. SDK Version: 34.0.0
  2. Platforms(Android/iOS/web/all): Android + ios

When calling this function, I manage to get my auth token, but I get this warning : Attempted to call AuthSession.startAsync multiple times while already active. Only one AuthSession can be active at any given time.

initConnection = async () => {

const url = getLoginUrl();
console.log("initConnection URL", url);
const result = await AuthSession.startAsync({
  authUrl: url,
});

if (result.type !== 'success') {
  console.log("RESULT TYPE WTF ");
  return null;
}

try {
  await AsyncStorage.setItem(AuthToken, result.params.code);
} catch (error) {
  // Error retrieving data
  console.log(error.message);
}

let gettoken = '';
try {
  gettoken = await AsyncStorage.getItem(AuthToken) || 'none';
} catch (error) {
  // Error retrieving data
  console.log(error.message);
}

}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.