forked from the-urlist/blazor-static-web-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject Hasher class and register as singleton service
The `Hasher` class is now being injected into the constructors of `CreateLinkBundle`, `DeleteLinkBundle`, `GetLinkBundlesForUser`, and `UpdateLinkBundle` classes, replacing the previous implementation where a new `Hasher` instance was created within these classes' methods. This change improves the testability and reusability of the `Hasher` class. The `Hasher` class is also registered as a singleton service in the `Program.cs` file, ensuring only one instance is used throughout the application's lifetime. It is initialized with `HASHER_KEY` and `HASHER_SALT` configuration values. The `Api` namespace, where `Hasher` is defined, is now being used in the `Program.cs` file. The creation of new `Hasher` instances has been removed from various places in the aforementioned classes due to the new injection approach.
- Loading branch information
1 parent
708d2d8
commit c31eb0f
Showing
5 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters