mirror of
https://github.com/documize/community.git
synced 2025-07-27 00:59:43 +02:00
Setting first/last name for all scenarios
This commit is contained in:
parent
399c36611f
commit
2ee9a9ff46
1 changed files with 10 additions and 6 deletions
|
@ -113,12 +113,16 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
|
||||||
u.GlobalAdmin = false
|
u.GlobalAdmin = false
|
||||||
u.Email = userInfo.User
|
u.Email = userInfo.User
|
||||||
|
|
||||||
u.Firstname = userInfo.Attributes.Get("first_name")
|
fn := userInfo.Attributes.Get("first_name")
|
||||||
u.Lastname = userInfo.Attributes.Get("last_name")
|
ln := userInfo.Attributes.Get("last_name")
|
||||||
if u.Firstname != "" || u.Lastname != "" {
|
if len(fn) > 0 || len(ln) > 0 {
|
||||||
u.Initials = stringutil.MakeInitials(u.Firstname, u.Lastname)
|
u.Initials = stringutil.MakeInitials(fn, ln)
|
||||||
|
u.Firstname = fn
|
||||||
|
u.Lastname = ln
|
||||||
} else {
|
} else {
|
||||||
u.Initials = stringutil.MakeInitials(userInfo.User, "")
|
u.Initials = stringutil.MakeInitials(userInfo.User, "")
|
||||||
|
u.Firstname = userInfo.User
|
||||||
|
u.Lastname = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
u.Salt = secrets.GenerateSalt()
|
u.Salt = secrets.GenerateSalt()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue