mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
Get firstname and lastname from CAS attributes
This commit is contained in:
parent
15e687841f
commit
fbb73560c0
2 changed files with 30 additions and 1 deletions
|
@ -112,7 +112,15 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
|
|||
u.Admin = false
|
||||
u.GlobalAdmin = false
|
||||
u.Email = userInfo.User
|
||||
u.Initials = stringutil.MakeInitials(userInfo.User, "")
|
||||
|
||||
firstName := userInfo.Attributes.Get("first_name")
|
||||
lastName := userInfo.Attributes.Get("last_name")
|
||||
if firstName != "" || lastName != "" {
|
||||
u.Initials = stringutil.MakeInitials(firstName, lastName)
|
||||
}else {
|
||||
u.Initials = stringutil.MakeInitials(userInfo.User, "")
|
||||
}
|
||||
|
||||
u.Salt = secrets.GenerateSalt()
|
||||
u.Password = secrets.GeneratePassword(secrets.GenerateRandomPassword(), u.Salt)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue