feat(identity): confirm the email address with a six-digit code from the message

This commit is contained in:
shira committed 2026-10-10 00:52:46 +03:00
1 parent c94434cd09
commit d365a05c96
87 files changed
+4764 -224

No files matched your search

@@ -24,6 +24,11 @@ type scriptedConfirmation struct {
command identity.ConfirmCommand
result identity.ConfirmationResult
calls int
codeErr error
codeCommand identity.ConfirmCodeCommand
codeResult identity.ConfirmationResult
codeCalls int
}
func (confirmation *scriptedConfirmation) Confirm(_ context.Context, command identity.ConfirmCommand) (identity.ConfirmationResult, error) {
@@ -32,6 +37,12 @@ func (confirmation *scriptedConfirmation) Confirm(_ context.Context, command ide
return confirmation.result, confirmation.err
}
func (confirmation *scriptedConfirmation) ConfirmByCode(_ context.Context, command identity.ConfirmCodeCommand) (identity.ConfirmationResult, error) {
confirmation.codeCalls++
confirmation.codeCommand = command
return confirmation.codeResult, confirmation.codeErr
}
func newConfirmationRouter(t *testing.T, confirmation v1.EmailConfirmation) http.Handler {
t.Helper()
logger := slog.New(slog.DiscardHandler)