I have Expo app with SIWA using Amplify Authentication. Took quite some time but I was able to set it up to a workable state using Amplify documentation 😅.
By using preferEphemeralSession: true option in WebBrowser.openAuthSessionAsync I'm able to prevent the dialog window (which is very frustrating UX, especially during signout) from showing BUT when I call Auth.signOut() the in-app browser still automatically opens and closes (see video). This is bad UX. Can this be solved (i.e. by a web call without the in-app browser opening)?
async function urlOpener(url, redirectUrl) {
const { type, url: newUrl } = await WebBrowser.openAuthSessionAsync(url, redirectUrl, {
preferEphemeralSession: true, // private session, so doesn't show dialog BUT asks apple verification code every time
});
if (type === 'success' && Platform.OS === 'ios') {
WebBrowser.dismissBrowser();
return Linking.openURL(newUrl);
}
}