mirror of https://github.com/coddrago/Heroku
Update web
parent
0112296998
commit
42d62c5b20
|
@ -31,7 +31,6 @@ from .. import utils
|
|||
|
||||
class Web:
|
||||
def __init__(self, **kwargs):
|
||||
self.heroku_api_token = os.environ.get("heroku_api_token")
|
||||
self.api_token = kwargs.pop("api_token")
|
||||
self.data_root = kwargs.pop("data_root")
|
||||
self.connection = kwargs.pop("connection")
|
||||
|
@ -66,7 +65,6 @@ class Web:
|
|||
return {
|
||||
"api_done": self.api_token is not None,
|
||||
"tg_done": bool(self.client_data),
|
||||
"heroku_token": self.heroku_api_token,
|
||||
"hosting": self.hosting,
|
||||
"default_app": self.default_app,
|
||||
}
|
||||
|
@ -161,12 +159,5 @@ class Web:
|
|||
async def finish_login(self, request):
|
||||
if not self.clients:
|
||||
return web.Response(status=400)
|
||||
text = await request.text()
|
||||
if text:
|
||||
if not re.fullmatch(r"[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}", text):
|
||||
return web.Response(status=400)
|
||||
self.heroku_api_token = text
|
||||
else:
|
||||
self.heroku_api_token = None
|
||||
self.clients_set.set()
|
||||
return web.Response()
|
||||
|
|
|
@ -203,7 +203,6 @@
|
|||
} else {
|
||||
return fetch("/finishLogin", {
|
||||
method: "POST",
|
||||
body: heroku_token,
|
||||
credentials: "include"
|
||||
})
|
||||
.then(function(response) {
|
||||
|
@ -273,7 +272,6 @@
|
|||
} else {
|
||||
fetch("/finishLogin", {
|
||||
method: "POST",
|
||||
body: '',
|
||||
credentials: "include"
|
||||
})
|
||||
.then(function(response) {
|
||||
|
|
Loading…
Reference in New Issue