mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-09 05:17:57 +01:00
added record.PasswordHash() getter
This commit is contained in:
1 parent
65693d1916
commit
46dc6cc47c
2 files changed
+21
-4
No files matched your search
@@ -1603,6 +1603,20 @@ func TestRecordLastVerificationSentAt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecordPasswordHash(t *testing.T) {
|
||||
m := models.NewRecord(&models.Collection{})
|
||||
|
||||
if v := m.PasswordHash(); v != "" {
|
||||
t.Errorf("Expected PasswordHash() to be empty, got %v", v)
|
||||
}
|
||||
|
||||
m.Set(schema.FieldNamePasswordHash, "test")
|
||||
|
||||
if v := m.PasswordHash(); v != "test" {
|
||||
t.Errorf("Expected PasswordHash() to be 'test', got %v", v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecordValidatePassword(t *testing.T) {
|
||||
// 123456
|
||||
hash := "$2a$10$YKU8mPP8sTE3xZrpuM.xQuq27KJ7aIJB2oUeKPsDDqZshbl5g5cDK"
|
||||
|
||||
Reference in new issue
Block a user