Implements language selector and some lang list improvements

This commit is contained in:
Denis Arh
2021-09-17 15:56:42 +02:00
parent 69b087549b
commit 92970c090a
+5 -1
View File
@@ -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
}