fix(notification): missing display name (#4653)
parent
a691131288
commit
a771cc6c2b
|
@ -18,6 +18,7 @@ func identityRetrieverFromSession(ctx *middlewares.AutheliaCtx) (*session.Identi
|
||||||
|
|
||||||
return &session.Identity{
|
return &session.Identity{
|
||||||
Username: userSession.Username,
|
Username: userSession.Username,
|
||||||
|
DisplayName: userSession.DisplayName,
|
||||||
Email: userSession.Emails[0],
|
Email: userSession.Emails[0],
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@ func identityRetrieverFromStorage(ctx *middlewares.AutheliaCtx) (*session.Identi
|
||||||
|
|
||||||
return &session.Identity{
|
return &session.Identity{
|
||||||
Username: requestBody.Username,
|
Username: requestBody.Username,
|
||||||
Email: details.Emails[0],
|
|
||||||
DisplayName: details.DisplayName,
|
DisplayName: details.DisplayName,
|
||||||
|
Email: details.Emails[0],
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,9 @@ func NewSMTPNotifier(config *schema.SMTPNotifierConfiguration, certPool *x509.Ce
|
||||||
at := strings.LastIndex(config.Sender.Address, "@")
|
at := strings.LastIndex(config.Sender.Address, "@")
|
||||||
|
|
||||||
if at >= 0 {
|
if at >= 0 {
|
||||||
domain = config.Sender.Address[at:]
|
domain = config.Sender.Address[at+1:]
|
||||||
|
} else {
|
||||||
|
domain = "localhost.localdomain"
|
||||||
}
|
}
|
||||||
|
|
||||||
return &SMTPNotifier{
|
return &SMTPNotifier{
|
||||||
|
|
|
@ -603,8 +603,8 @@ func RandomInt(n int) (int, error) {
|
||||||
|
|
||||||
max := big.NewInt(int64(n))
|
max := big.NewInt(int64(n))
|
||||||
|
|
||||||
if max.IsUint64() {
|
if !max.IsUint64() {
|
||||||
return 0, fmt.Errorf("generated max is uint64")
|
return 0, fmt.Errorf("generated max is negative")
|
||||||
}
|
}
|
||||||
|
|
||||||
value, err := rand.Int(rand.Reader, max)
|
value, err := rand.Int(rand.Reader, max)
|
||||||
|
|
Loading…
Reference in New Issue