1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

update user firstname and lastname when login with CAS

This commit is contained in:
Derek Chen 2019-08-18 21:33:25 +08:00
parent fbb73560c0
commit 399c36611f

View file

@ -113,10 +113,10 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
u.GlobalAdmin = false
u.Email = userInfo.User
firstName := userInfo.Attributes.Get("first_name")
lastName := userInfo.Attributes.Get("last_name")
if firstName != "" || lastName != "" {
u.Initials = stringutil.MakeInitials(firstName, lastName)
u.Firstname = userInfo.Attributes.Get("first_name")
u.Lastname = userInfo.Attributes.Get("last_name")
if u.Firstname != "" || u.Lastname != "" {
u.Initials = stringutil.MakeInitials(u.Firstname, u.Lastname)
}else {
u.Initials = stringutil.MakeInitials(userInfo.User, "")
}