Skip to content

Refactored UserSession context functions#7100

Merged
Rwolfe-Nava merged 3 commits intomainfrom
lg7324-refactor-context-functions
Oct 6, 2022
Merged

Refactored UserSession context functions#7100
Rwolfe-Nava merged 3 commits intomainfrom
lg7324-refactor-context-functions

Conversation

@Rwolfe-Nava
Copy link
Contributor

@Rwolfe-Nava Rwolfe-Nava commented Oct 6, 2022

changelog: Internal, General, Refactored inconsistent function names

🎫 Ticket

LG-7324

🛠 Summary of changes

Refactored function names in user_session_context.rb that were a bit confusing. reauthentication_context? and confirmation_context? both check explicitly for the respective contexts. Intuitively, one would expect authentication_context? to do the same, but it was checking either authentication or reauthentication. This renames authentication_context? and intiial_authentication_context? to more accurately describe what they are doing.

changelog: Internal, General, Refactored inconsistent function names
Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
Copy link
Contributor

@n1zyy n1zyy left a comment

Choose a reason for hiding this comment

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

git praise shows @aduth and @mitchellhenke were the initial authors of this if you want their buy-in, but :shipit: from my perspective.

end

def self.authentication_context?(context)
initial_authentication_context?(context) || reauthentication_context?(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

I forgot what a footgun this method was until you picked up this story. Thanks for fixing this!

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Looks like a nice improvement for clarity! 👍

@Rwolfe-Nava Rwolfe-Nava merged commit 9f6537a into main Oct 6, 2022
@Rwolfe-Nava Rwolfe-Nava deleted the lg7324-refactor-context-functions branch October 6, 2022 15:51
jskinne3 pushed a commit that referenced this pull request Oct 12, 2022
* Refactored UserSession context functions

changelog: Internal, General, Refactored inconsistent function names

* Update app/services/user_session_context.rb

Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>

* lint fixes

Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
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.

3 participants