summaryrefslogtreecommitdiffstats
path: root/api/WhatApi/Extras/PasswordHasher.cs
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-12-03 21:49:20 +0100
committerivar <i@oiee.no>2025-12-03 21:49:20 +0100
commitcd70f54266d708867a1eb35870bc755bc5b2df32 (patch)
treef0a8ec571ef3f345ac74293b4cb11918878b3ed5 /api/WhatApi/Extras/PasswordHasher.cs
parent5bd9ad8bd1740dcff179d66718532086304ca4c4 (diff)
downloadwhat-cd70f54266d708867a1eb35870bc755bc5b2df32.tar.xz
what-cd70f54266d708867a1eb35870bc755bc5b2df32.zip
Refactor db
Diffstat (limited to 'api/WhatApi/Extras/PasswordHasher.cs')
-rw-r--r--api/WhatApi/Extras/PasswordHasher.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/api/WhatApi/Extras/PasswordHasher.cs b/api/WhatApi/Extras/PasswordHasher.cs
new file mode 100644
index 0000000..88e69a7
--- /dev/null
+++ b/api/WhatApi/Extras/PasswordHasher.cs
@@ -0,0 +1,23 @@
+using Microsoft.AspNetCore.Identity;
+
+namespace WhatApi.Extras;
+
+public class VendorPasswordHasher : PasswordHasher<User>;
+
+public static class PasswordHasher
+{
+ private static readonly VendorPasswordHasher _ = new();
+ private static readonly User User = new() {
+ Name = "",
+ Email = "",
+ PasswordHash = ""
+ };
+
+ public static string HashPassword(string password) {
+ return _.HashPassword(User, password);
+ }
+
+ public static PasswordVerificationResult VerifyHashedPassword(string hashedPassword, string providedPassword) {
+ return _.VerifyHashedPassword(User, hashedPassword, providedPassword);
+ }
+} \ No newline at end of file