diff --git a/auth/handlers/handle_oauth2.go b/auth/handlers/handle_oauth2.go index 3fecb8a6b..dc1a31ded 100644 --- a/auth/handlers/handle_oauth2.go +++ b/auth/handlers/handle_oauth2.go @@ -407,7 +407,7 @@ func SubSplit(ti oauth2def.TokenInfo, data map[string]interface{}) { // Profile fills map with user's data // // If scope supports it (contains "profile") user is loaded and -// map is sfilled with username (handle), email and name +// map is filled with username (handle), email and name func Profile(ctx context.Context, ti oauth2def.TokenInfo, data map[string]interface{}) error { if !auth.CheckScope(ti.GetScope(), "profile") { return nil @@ -433,6 +433,10 @@ func Profile(ctx context.Context, ti oauth2def.TokenInfo, data map[string]interf data["name"] = user.Name data["email"] = user.Email + if user.Meta != nil && user.Meta.PreferredLanguage != "" { + data["preferred_language"] = user.Meta.PreferredLanguage + } + return nil }