Merge pull request #220 from gradido/login_add_language

Login add language
This commit is contained in:
einhornimmond 2021-04-22 12:33:17 +02:00 committed by GitHub
commit 6101780d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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"
}
```
```

View File

@ -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");