mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-05 07:20:13 +01:00
Merge pull request #164 from fushinari/suggest-req-key
Require API key for submitting suggestions
This commit is contained in:
commit
922ba5de40
@ -811,7 +811,7 @@ def create_app(args):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@app.route("/suggest", methods=["POST"])
|
@app.route("/suggest", methods=["POST"])
|
||||||
@limiter.exempt
|
@access_check
|
||||||
def suggest():
|
def suggest():
|
||||||
"""
|
"""
|
||||||
Submit a suggestion to improve a translation
|
Submit a suggestion to improve a translation
|
||||||
|
@ -290,6 +290,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||||||
data.append("s", self.translatedText);
|
data.append("s", self.translatedText);
|
||||||
data.append("source", self.sourceLang);
|
data.append("source", self.sourceLang);
|
||||||
data.append("target", self.targetLang);
|
data.append("target", self.targetLang);
|
||||||
|
data.append("api_key", localStorage.getItem("api_key") || "");
|
||||||
|
|
||||||
request.open('POST', BaseUrl + '/suggest', true);
|
request.open('POST', BaseUrl + '/suggest', true);
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user