Fix issue with localauth conversion
This commit is contained in:
parent
045bcb7bf6
commit
3a80acae37
|
@ -38,19 +38,25 @@ func (a Account) ToStorageType() storage.Account {
|
|||
}
|
||||
|
||||
func (lc LocalAuth) ToStorageType() storage.LocalAuth {
|
||||
emailValidation := storage.Validation{}
|
||||
if lc.EmailValidation != nil {
|
||||
emailValidation.Validated = lc.EmailValidation.Validated
|
||||
emailValidation.ValidationCode = lc.EmailValidation.ValidationCode
|
||||
}
|
||||
|
||||
phoneValidation := storage.Validation{}
|
||||
if lc.PhoneNumberValidation != nil {
|
||||
phoneValidation.Validated = lc.PhoneNumberValidation.Validated
|
||||
phoneValidation.ValidationCode = lc.PhoneNumberValidation.ValidationCode
|
||||
}
|
||||
|
||||
return storage.LocalAuth{
|
||||
Username: lc.Username,
|
||||
Password: lc.Password,
|
||||
Email: lc.Email,
|
||||
EmailValidation: storage.Validation{
|
||||
Validated: lc.EmailValidation.Validated,
|
||||
ValidationCode: lc.EmailValidation.ValidationCode,
|
||||
},
|
||||
PhoneNumber: lc.PhoneNumber,
|
||||
PhoneNumberValidation: storage.Validation{
|
||||
Validated: lc.PhoneNumberValidation.Validated,
|
||||
ValidationCode: lc.PhoneNumberValidation.ValidationCode,
|
||||
},
|
||||
Username: lc.Username,
|
||||
Password: lc.Password,
|
||||
Email: lc.Email,
|
||||
EmailValidation: emailValidation,
|
||||
PhoneNumber: lc.PhoneNumber,
|
||||
PhoneNumberValidation: phoneValidation,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue