mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 20:08:02 +00:00
19 lines
608 B
Go
19 lines
608 B
Go
|
package eventsourcing
|
||
|
|
||
|
import (
|
||
|
"github.com/caos/zitadel/internal/crypto"
|
||
|
usr_model "github.com/caos/zitadel/internal/user/model"
|
||
|
"github.com/caos/zitadel/internal/user/repository/eventsourcing/model"
|
||
|
)
|
||
|
|
||
|
func (es *UserEventstore) generatePasswordCode(passwordCode *model.PasswordCode, notifyType usr_model.NotificationType) error {
|
||
|
passwordCodeCrypto, _, err := crypto.NewCode(es.PasswordVerificationCode)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
passwordCode.Code = passwordCodeCrypto
|
||
|
passwordCode.Expiry = es.PasswordVerificationCode.Expiry()
|
||
|
passwordCode.NotificationType = int32(notifyType)
|
||
|
return nil
|
||
|
}
|