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