From 92970c090adfce6ac024a554c4a5a2bdc1c8053f Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Fri, 17 Sep 2021 01:16:08 +0200 Subject: [PATCH] Implements language selector and some lang list improvements --- auth/handlers/handle_oauth2.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 }