-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fixes #16
Fixes #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -21,7 +21,7 @@ public async Task<UserStorageDto> Create(string password) | |||||
{ | ||||||
var username = this.GetPrimaryKeyString(); | ||||||
await EnsureUnique(); | ||||||
await managerService.Validate(username, password); | ||||||
managerService.Validate(username, password); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Restore asynchronous validation to prevent potential blocking The removal of Apply this diff to restore asynchronous behavior: - managerService.Validate(username, password);
+ await managerService.Validate(username, password); 📝 Committable suggestion
Suggested change
💡 Codebase verification The Validate method is async and should be awaited The await managerService.Validate(username, password); 🔗 Analysis chainVerify the implementation of UserManagerService.Validate Let's verify if the Validate method contains any async operations that would require awaiting. Let me gather more information about the implementation of the Validate method. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for the Validate method implementation in UserManagerService
ast-grep --pattern 'class UserManagerService {
$$$
Validate($$$) {
$$$
}
$$$
}'
# Also check for any async operations within the service
rg -l "await" -g "UserManagerService.cs"
Length of output: 177 Script: #!/bin/bash
# Let's see the actual content of UserManagerService.cs to check the Validate method implementation
cat src/Argon.Api/Services/UserManagerService.cs
Length of output: 2863 |
||||||
|
||||||
userStore.State.Id = Guid.NewGuid(); | ||||||
userStore.State.Username = username; | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,7 @@ | |
"dotnetRunMessages": true, | ||
"launchBrowser": false, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "http://localhost:5100", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"https": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": false, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "https://localhost:7206;http://localhost:5100", | ||
"applicationUrl": "https://localhost:5100", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Using HTTPS URL in HTTP profile may cause confusion. While switching to HTTPS is good for security, having an HTTPS URL in a profile named "http" is counterintuitive and could lead to confusion. Consider renaming the profile to better reflect its purpose. "profiles": {
- "http": {
+ "https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:5100",
|
||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider keeping the [ApiController] attribute.
Removing the [ApiController] attribute disables useful ASP.NET Core conveniences like automatic model validation, inference of [FromBody] attributes, and better error handling. Unless there's a specific reason to remove it, keeping this attribute is recommended for consistent controller behavior.
+[ApiController] public class MetadataController : ControllerBase
📝 Committable suggestion