summaryrefslogtreecommitdiffstats
path: root/api/WhatApi/Extras/PasswordHasher.cs
blob: 88e69a785ea79f9e8c08a6b4f5230c2eed08a790 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
    }
}