Other: added user's primary email address to the vault.

This commit is contained in:
Xavier Michelon
2023-01-17 10:16:12 +01:00
parent 03c8c323bc
commit a377384553
8 changed files with 70 additions and 20 deletions

View File

@ -38,6 +38,18 @@ func (user *User) Username() string {
return user.vault.getUser(user.userID).Username
}
// PrimaryEmail returns the user's primary email address.
func (user *User) PrimaryEmail() string {
return user.vault.getUser(user.userID).PrimaryEmail
}
// SetPrimaryEmail sets the user's primary email address.
func (user *User) SetPrimaryEmail(email string) error {
return user.vault.modUser(user.userID, func(data *UserData) {
data.PrimaryEmail = email
})
}
// GluonKey returns the key needed to decrypt the user's gluon database.
func (user *User) GluonKey() []byte {
return user.vault.getUser(user.userID).GluonKey