implement email verification feature, add captcha validation middleware, and enhance user authentication flow

This commit is contained in:
2025-07-22 08:50:16 +08:00
parent 6187425df6
commit a0d215fa2e
26 changed files with 844 additions and 50 deletions

19
pkg/errs/errors_test.go Normal file
View File

@ -0,0 +1,19 @@
package errs
import (
"testing"
)
func TestAsServiceError(c) {
serviceError := ErrNotFound
err := AsServiceError(serviceError)
if err.Code != serviceError.Code || err.Message != serviceError.Message {
t.Errorf("Expected %v, got %v", serviceError, err)
}
serviceError = New(520, "Custom error", nil)
err = AsServiceError(serviceError)
if err.Code != serviceError.Code || err.Message != serviceError.Message {
t.Errorf("Expected %v, got %v", serviceError, err)
}
}