implement Email as username
This commit is contained in:
10
core/user.go
10
core/user.go
@@ -10,7 +10,7 @@ import (
|
||||
type User struct {
|
||||
Id UserId
|
||||
CustomerId CustomerId
|
||||
Username Username
|
||||
Email Email
|
||||
EncipheredPasscode EncipheredNKode
|
||||
Kp KeypadDimension
|
||||
CipherKeys UserCipherKeys
|
||||
@@ -117,7 +117,11 @@ func ValidKeyEntry(user User, customer Customer, selectedKeys []int) ([]int, err
|
||||
return presumedAttrIdxVals, nil
|
||||
}
|
||||
|
||||
func NewUser(customer Customer, username Username, passcodeIdx []int, ui UserInterface, kp KeypadDimension) (*User, error) {
|
||||
func NewUser(customer Customer, userEmail string, passcodeIdx []int, ui UserInterface, kp KeypadDimension) (*User, error) {
|
||||
_, err := ParseEmail(userEmail)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
setVals, err := customer.Attributes.SetValsForKp(kp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -132,7 +136,7 @@ func NewUser(customer Customer, username Username, passcodeIdx []int, ui UserInt
|
||||
}
|
||||
newUser := User{
|
||||
Id: UserId(uuid.New()),
|
||||
Username: username,
|
||||
Email: Email(userEmail),
|
||||
EncipheredPasscode: *encipheredNKode,
|
||||
CipherKeys: *newKeys,
|
||||
Interface: ui,
|
||||
|
||||
Reference in New Issue
Block a user