fix(notification): missing display name (#4653)

pull/4651/head
James Elliott 2022-12-27 10:54:58 +11:00 committed by GitHub
parent a691131288
commit a771cc6c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -18,6 +18,7 @@ func identityRetrieverFromSession(ctx *middlewares.AutheliaCtx) (*session.Identi
return &session.Identity{
Username: userSession.Username,
DisplayName: userSession.DisplayName,
Email: userSession.Emails[0],
}, nil
}

View File

@ -29,8 +29,8 @@ func identityRetrieverFromStorage(ctx *middlewares.AutheliaCtx) (*session.Identi
return &session.Identity{
Username: requestBody.Username,
Email: details.Emails[0],
DisplayName: details.DisplayName,
Email: details.Emails[0],
}, nil
}

View File

@ -56,7 +56,9 @@ func NewSMTPNotifier(config *schema.SMTPNotifierConfiguration, certPool *x509.Ce
at := strings.LastIndex(config.Sender.Address, "@")
if at >= 0 {
domain = config.Sender.Address[at:]
domain = config.Sender.Address[at+1:]
} else {
domain = "localhost.localdomain"
}
return &SMTPNotifier{

View File

@ -603,8 +603,8 @@ func RandomInt(n int) (int, error) {
max := big.NewInt(int64(n))
if max.IsUint64() {
return 0, fmt.Errorf("generated max is uint64")
if !max.IsUint64() {
return 0, fmt.Errorf("generated max is negative")
}
value, err := rand.Int(rand.Reader, max)