mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 15:45:05 +00:00
feat: add ability to send login code via email (#457)
Co-authored-by: Kyle Mendell <kmendell@ofkm.us>
This commit is contained in:
@@ -104,10 +104,10 @@ func SendEmail[V any](ctx context.Context, srv *EmailService, toEmail email.Addr
|
||||
// so we use the domain of the from address instead (the same as Thunderbird does)
|
||||
// if the address does not have an @ (which would be unusual), we use hostname
|
||||
|
||||
from_address := dbConfig.SmtpFrom.Value
|
||||
fromAddress := dbConfig.SmtpFrom.Value
|
||||
domain := ""
|
||||
if strings.Contains(from_address, "@") {
|
||||
domain = strings.Split(from_address, "@")[1]
|
||||
if strings.Contains(fromAddress, "@") {
|
||||
domain = strings.Split(fromAddress, "@")[1]
|
||||
} else {
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user