Skip to content

Commit

Permalink
longer timeout for first page load during passwordless auth (#501)
Browse files Browse the repository at this point in the history
Users see occasional timeouts on the first page load during passwordless
auth.
The first page load is always cutting a bit too close to the timeout.
Good to increase the timeout to reduce random failures.

https://desire2learn.atlassian.net/browse/VUL-626
  • Loading branch information
cfbao authored Jan 15, 2025
1 parent 43bab53 commit 93c5db7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/D2L.Bmx/OktaAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ The provided Okta user '{providedLogin}' does not match the system configured pa
using var cancellationTokenSource = new CancellationTokenSource( TimeSpan.FromSeconds( 15 ) );
cancellationTokenSource.Token.Register( () => sessionIdTcs.TrySetCanceled() );

// cancel if we're stuck on a single page for 3 seconds
using var pageTimer = new System.Timers.Timer( TimeSpan.FromSeconds( 3 ) ) { AutoReset = false };
// cancel if we can't load the first page for 6 seconds
using var pageTimer = new System.Timers.Timer( TimeSpan.FromSeconds( 6 ) ) { AutoReset = false };
pageTimer.Elapsed += ( _, _ ) => cancellationTokenSource.Cancel();
pageTimer.Start();

Expand All @@ -185,9 +185,11 @@ The provided Okta user '{providedLogin}' does not match the system configured pa
return await sessionIdTcs.Task;

async Task OnPageLoadAsync() {
// reset the 3-sec per-page timer on every page load
// reset the per-page timer on every page load
lock( pageTimer ) {
pageTimer.Stop();
// we give the first page 6 sec to load, but 3 sec is probably enough for subsequent pages
pageTimer.Interval = 3000;
pageTimer.Start();
}

Expand Down

0 comments on commit 93c5db7

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy