Updated WebAuth to cancel any newly triggered WebAuth transactions when there exists an active WebAuth transaction already i.e ensuring that only single WebAuth transaction is active at any point of time.
The above change would fix the issues in some special cases of race condition where continuations are misused by resuming twice.
Updated unit tests for login & logout in WebAuthSpec to clear TransactionStore before each run to start clean and not get failed by the un-cleared transaction in memory by previous test runs.
[x] All new/changed/fixed functionality is covered by tests (or N/A)
[x] I have added documentation for all new/changed functionality (or N/A)
🎯 Testing
Tested by trying to start the below defined two flows at exact same time via both callbacks & async/await approach and found that the code is working as per expectations by cancelling the newly triggering web auth flow and ensuring the existing web auth flow executes completely.
WebAuth flow with google-oauth2 connection using ASWebAuthenticationSession
WebAuth flow with Universal Login using SafariViewController
📋 Changes
login
&logout
in WebAuthSpec to clearTransactionStore
before each run to start clean and not get failed by the un-cleared transaction in memory by previous test runs.📎 References
auth0/Auth0.swift#827
Checklist
🎯 Testing
Tested by trying to start the below defined two flows at exact same time via both callbacks & async/await approach and found that the code is working as per expectations by cancelling the newly triggering web auth flow and ensuring the existing web auth flow executes completely.
google-oauth2
connection usingASWebAuthenticationSession
Universal Login
usingSafariViewController