mirror of https://gitlab.com/litecord/litecord.git
allow api v9
This commit is contained in:
parent
111444c545
commit
abd2eb94e3
|
|
@ -131,7 +131,11 @@ async def _register_with_invite():
|
|||
@bp.route("/login", methods=["POST"])
|
||||
async def login():
|
||||
j = await request.get_json()
|
||||
try:
|
||||
email, password = j["email"], j["password"]
|
||||
except KeyError:
|
||||
# hack for api v9
|
||||
email, password = j["login"], j["password"]
|
||||
|
||||
row = await app.db.fetchrow(
|
||||
"""
|
||||
|
|
|
|||
6
run.py
6
run.py
|
|
@ -129,6 +129,9 @@ def make_app():
|
|||
return app
|
||||
|
||||
|
||||
PREFIXES = ("/api/v6", "/api/v7", "/api/v8", "/api/v9")
|
||||
|
||||
|
||||
def set_blueprints(app_):
|
||||
"""Set the blueprints for a given app instance"""
|
||||
bps = {
|
||||
|
|
@ -167,7 +170,8 @@ def set_blueprints(app_):
|
|||
}
|
||||
|
||||
for bp, suffix in bps.items():
|
||||
url_prefix = f'/api/v6{suffix or ""}'
|
||||
for prefix in PREFIXES:
|
||||
url_prefix = f'{prefix}{suffix or ""}'
|
||||
|
||||
if suffix == -1:
|
||||
url_prefix = ""
|
||||
|
|
|
|||
Loading…
Reference in New Issue