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 {
|
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{
|
return storage.LocalAuth{
|
||||||
Username: lc.Username,
|
Username: lc.Username,
|
||||||
Password: lc.Password,
|
Password: lc.Password,
|
||||||
Email: lc.Email,
|
Email: lc.Email,
|
||||||
EmailValidation: storage.Validation{
|
EmailValidation: emailValidation,
|
||||||
Validated: lc.EmailValidation.Validated,
|
|
||||||
ValidationCode: lc.EmailValidation.ValidationCode,
|
|
||||||
},
|
|
||||||
PhoneNumber: lc.PhoneNumber,
|
PhoneNumber: lc.PhoneNumber,
|
||||||
PhoneNumberValidation: storage.Validation{
|
PhoneNumberValidation: phoneValidation,
|
||||||
Validated: lc.PhoneNumberValidation.Validated,
|
|
||||||
ValidationCode: lc.PhoneNumberValidation.ValidationCode,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue