react-native-azure-auth icon indicating copy to clipboard operation
react-native-azure-auth copied to clipboard

ClearSession WebView iOS error when closing

Open NadiaMit opened this issue 1 year ago • 2 comments

Hi,

I am facing the same problem as mentioned in this issue: #122 I know this issue was closed, because the issue seemed to be resolved, but it was only resolved for Android. In iOS when i use azureAuth.webAuth.clearSession() to log the user out, it opens the WebView, logs the user out correctly, but then it doesn't close the WebView, even if I set closeOnLoad: true. If i then click the cancel/X - Button to close the WebView, it gives me the error: aa.session.user_cancelled. Since i get an error, the function i want to execute after (in the .then() call of the promise) isn't being executed and the user stays on the same screen, even tho I want to change screen after the logout.

Has anybody found a workaround for this or is there a way to fix this?

This is my function:

function logout() {
    azureAuth.webAuth
      .clearSession({ closeOnLoad: true })
      .then(() => {
        //send user to different screen when logout done successfully
        onSuccessfulLogout()
      })
      .catch(error => console.log(error))
  }

NadiaMit avatar Aug 11 '23 14:08 NadiaMit

Hi, I have same problem with this.

I was wondering problem isn't about closeOnLoad param. Promise clearSession doesn't end. If you close safari/chrome tab, goes to catch handler

@vmurin could you give more information about that?

juan-martin-ts avatar Oct 19 '23 11:10 juan-martin-ts

Same here! @vmurin

nherreros avatar Oct 20 '23 08:10 nherreros