mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
112f672266
* chore: cleanup command/crypto * cleanup unused function mockEmailCode
29 lines
739 B
Go
29 lines
739 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/command/preparation"
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
)
|
|
|
|
type Email struct {
|
|
Address domain.EmailAddress
|
|
Verified bool
|
|
|
|
// ReturnCode is used if the Verified field is false
|
|
ReturnCode bool
|
|
|
|
// URLTemplate can be used to specify a custom link to be sent in the mail verification
|
|
URLTemplate string
|
|
}
|
|
|
|
func (e *Email) Validate() error {
|
|
return e.Address.Validate()
|
|
}
|
|
|
|
func (c *Commands) newEmailCode(ctx context.Context, filter preparation.FilterToQueryReducer, alg crypto.EncryptionAlgorithm) (*CryptoCode, error) {
|
|
return c.newCode(ctx, filter, domain.SecretGeneratorTypeVerifyEmailCode, alg)
|
|
}
|