diff --git a/docu/login_server.api.md b/docu/login_server.api.md index 5cf44c422..025e04094 100644 --- a/docu/login_server.api.md +++ b/docu/login_server.api.md @@ -60,7 +60,7 @@ In case of success returns: "public_hex": "131c7f68dd94b2be4c913400ff7ff4cdc03ac2bda99c2d29edcacb3b065c67e6", "role": "none", "username": "" - } + }, "session_id": -127182, "clientIP":"123.123.123.123" } @@ -235,6 +235,7 @@ with: "user.last_name", "user.disabled", "user.email_checked", + "user.language" ] } ``` @@ -269,6 +270,7 @@ Return only the fields which are defined in request - `user.disabled`: User will be disabled if he wants a account delete but has transactions. Until transactions are saved in real blockchain, we need this data because the public key is in db only saved in state_users so if we delete this entry, validating all transactions is no longer possible. Disabled User cannot login and cannot receive transactions. - `email_checked`: If user has clicked on link in verification email (register), can only transfer gradidos if email_checked is 1 +- `language`: Language Key for User, currently 'de' or 'en' - `errors`: array of strings if error occure ## Login by Email Verification Code @@ -302,7 +304,7 @@ In case of success returns: "public_hex": "131c7f68dd94b2be4c913400ff7ff4cdc03ac2bda99c2d29edcacb3b065c67e6", "role": "none", "username": "" - } + }, "session_id":1853761475 } ``` @@ -491,4 +493,4 @@ or: "state":"not found", "msg": "session not found" } -``` \ No newline at end of file +``` diff --git a/login_server/src/cpp/JSONInterface/JsonGetUserInfos.cpp b/login_server/src/cpp/JSONInterface/JsonGetUserInfos.cpp index 7f13c7d29..2b1f229de 100644 --- a/login_server/src/cpp/JSONInterface/JsonGetUserInfos.cpp +++ b/login_server/src/cpp/JSONInterface/JsonGetUserInfos.cpp @@ -131,6 +131,9 @@ Poco::JSON::Object* JsonGetUserInfos::handle(Poco::Dynamic::Var params) auto email = user_model->getEmail(); jsonUser.set("identHash", DRMakeStringHash(email.data(), email.size())); } + else if (parameterString == "user.language") { + jsonUser.set("language", user_model->getLanguageKey()); + } } catch (Poco::Exception& ex) { jsonErrorsArray.add("ask parameter invalid");