Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(5.0) fix: handleLoginRedirect should not subscribe to auth state changes #730

Closed

Conversation

aarongranick-okta
Copy link
Contributor

  • updateAuthState now returns a promise that can be awaited

@codecov-commenter
Copy link

codecov-commenter commented May 11, 2021

Codecov Report

Merging #730 (5cf259a) into master (6fcce31) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #730      +/-   ##
==========================================
+ Coverage   81.05%   81.15%   +0.09%     
==========================================
  Files         103      103              
  Lines        2967     2972       +5     
  Branches      601      602       +1     
==========================================
+ Hits         2405     2412       +7     
+ Misses        562      560       -2     
Impacted Files Coverage Δ
lib/AuthStateManager.ts 93.47% <100.00%> (+2.89%) ⬆️
lib/OktaAuth.ts 88.04% <100.00%> (-0.10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fcce31...5cf259a. Read the comment docs.

@@ -67,7 +67,7 @@ export class AuthStateManager {
return this._authState;
}

updateAuthState(): void {
async updateAuthState(): Promise<AuthState> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should here be considered as a breaking change? Technically, we are exposing authStateManager from authClient (https://github.com/okta/okta-auth-js/blob/master/lib/OktaAuth.ts#L260)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not a breaking change, as app code won't change because of this signature change.

Copy link
Contributor

@shuowu shuowu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -92,12 +92,22 @@ export class AuthStateManager {
devMode && log('emitted');
};

const finalPromise = (origPromise) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making the finalPromise returns a function instead of a promise? In this way, I think we can resolve the concern about the promise may become stale.

@shuowu shuowu self-requested a review May 11, 2021 12:45
eng-prod-CI-bot-okta pushed a commit that referenced this pull request May 13, 2021
OKTA-391495
<<<Jenkins Check-In of Tested SHA: 2e329e8 for eng_productivity_ci_bot_okta@okta.com>>>
Artifact: okta-auth-js
Files changed count: 6
PR Link: "#730"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants