Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestDefaultPasswordResetTTL(t *testing.T) {
|
||||
t.Parallel()
|
||||
if DefaultPasswordResetTTL != time.Hour {
|
||||
t.Fatalf("DefaultPasswordResetTTL=%v want 1h", DefaultPasswordResetTTL)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssuePasswordResetRejectsSyntheticEmail(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &Service{} // no Pool — synthetic check must return before any DB use
|
||||
for _, email := range []string{
|
||||
"user_abc@legacy.local",
|
||||
" User_ABC@Legacy.Local ",
|
||||
} {
|
||||
_, err := s.IssuePasswordReset(t.Context(), email, 0)
|
||||
if !errors.Is(err, ErrSyntheticEmail) {
|
||||
t.Fatalf("email=%q err=%v want ErrSyntheticEmail", email, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user