MCPcopy Index your code
hub / github.com/writefreely/writefreely / EmailClear

Method EmailClear

users.go:95–110  ·  view source on GitHub ↗

EmailClear decrypts and returns the user's email, caching it in the user object.

(keys *key.Keychain)

Source from the content-addressed store, hash-verified

93// EmailClear decrypts and returns the user's email, caching it in the user
94// object.
95func (u *User) EmailClear(keys *key.Keychain) string {
96 if u.clearEmail != "" {
97 return u.clearEmail
98 }
99
100 if u.Email.Valid && u.Email.String != "" {
101 email, err := data.Decrypt(keys.EmailKey, []byte(u.Email.String))
102 if err != nil {
103 log.Error("Error decrypting user email: %v", err)
104 } else {
105 u.clearEmail = string(email)
106 return u.clearEmail
107 }
108 }
109 return ""
110}
111
112func (u User) CreatedFriendly() string {
113 /*

Callers 4

viewSettingsFunction · 0.80
handleResetPasswordInitFunction · 0.80
loginViaEmailFunction · 0.80
handleViewAdminUserFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected