Skip to content

[release/2.3] Merge internal commits for May #61922

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

Merged
merged 4 commits into from
May 13, 2025
Merged

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented May 13, 2025

No description provided.

Mirroring and others added 4 commits March 11, 2025 22:26
…covery code

# Add empty string check for recovery code

If an empty string gets passed as the recovery code to `UserStoreBase.RedeemCodeAsync(TUser user, string code, CancellationToken ct)`, the method returns `true`, incorrectly indicating a valid recovery code. This PR resolves the issue by validating that the `code` argument is not an empty string.

## Description

The `RedeemCodeAsync()` method already validates that `code` is non-null. This PR:
* Extends the logic in this method to handle the empty string (`""`) case
* Adds tests validating that an exception gets thrown when `code` is `null` or `""`

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request adds a check for empty recovery codes to prevent invalid inputs.
- `src/Identity/Extensions.Stores/src/UserStoreBase.cs`: Added a check to throw an `ArgumentException` if the recovery code is an empty string.
- `src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs`: Added tests to ensure `RedeemCodeAsync` throws appropriate exceptions for null and empty recovery codes.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request adds a check for empty recovery codes to prevent invalid inputs.
- `src/Identity/Extensions.Stores/src/UserStoreBase.cs`: Added a check to throw an `ArgumentException` if the recovery code is an empty string.
- `src/Identity/EntityFrameworkCore/test/EF.Test/UserStoreTest.cs`: Added tests to ensure `RedeemCodeAsync` throws appropriate exceptions for null and empty recovery codes.
@wtgodbe wtgodbe requested a review from MackinnonBuck May 13, 2025 21:48
@wtgodbe wtgodbe requested a review from a team as a code owner May 13, 2025 21:48
@wtgodbe wtgodbe merged commit 67bc7ee into release/2.3 May 13, 2025
2 of 4 checks passed
@wtgodbe wtgodbe deleted the wtgodbe/Port23 branch May 13, 2025 21:52
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.

1 participant