Change authentication endpoint

This commit is contained in:
Mark Veidemanis 2022-08-18 07:20:30 +01:00
parent f004bd47af
commit d78600a2f1
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 4 additions and 1 deletions

View File

@ -194,7 +194,7 @@ class API(object):
} }
return dumps(networks) return dumps(networks)
@app.route("/irc/network/auth/", methods=["POST"]) @app.route("/irc/auth/", methods=["POST"])
@login_required @login_required
def irc_network_recheckauth(self, request): def irc_network_recheckauth(self, request):
try: try:
@ -214,6 +214,7 @@ class API(object):
if net not in main.network.keys(): if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."}) return dumps({"success": False, "reason": "no such net."})
nets = [net] nets = [net]
print("NETS", nets)
for net_name in nets: for net_name in nets:
conns = helpers.get_connected_relays(net_name) conns = helpers.get_connected_relays(net_name)
if not conns: if not conns:
@ -227,12 +228,14 @@ class API(object):
conn.regPing(reset=True) conn.regPing(reset=True)
elif func == "register": elif func == "register":
for conn in conns: for conn in conns:
print("REGISTER ACCOUNT", conn.net, conn.num)
regproc.registerAccount(conn.net, conn.num) regproc.registerAccount(conn.net, conn.num)
return dumps({"success": True}) return dumps({"success": True})
@app.route("/irc/network/<net>/", methods=["POST"]) @app.route("/irc/network/<net>/", methods=["POST"])
@login_required @login_required
def irc_network(self, request, net): def irc_network(self, request, net):
print("IRC_NETWORK")
if net not in main.network.keys(): if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."}) return dumps({"success": False, "reason": "no such net."})
inst = main.network[net] inst = main.network[net]