mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-12-22 23:26:31 +00:00
Merge pull request #164 from fushinari/suggest-req-key
Require API key for submitting suggestions
This commit is contained in:
commit
922ba5de40
2 changed files with 2 additions and 1 deletions
|
@ -811,7 +811,7 @@ def create_app(args):
|
|||
)
|
||||
|
||||
@app.route("/suggest", methods=["POST"])
|
||||
@limiter.exempt
|
||||
@access_check
|
||||
def suggest():
|
||||
"""
|
||||
Submit a suggestion to improve a translation
|
||||
|
|
|
@ -290,6 +290,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||
data.append("s", self.translatedText);
|
||||
data.append("source", self.sourceLang);
|
||||
data.append("target", self.targetLang);
|
||||
data.append("api_key", localStorage.getItem("api_key") || "");
|
||||
|
||||
request.open('POST', BaseUrl + '/suggest', true);
|
||||
request.onload = function() {
|
||||
|
|
Loading…
Reference in a new issue