app.py is an abhorrent abomination
This commit is contained in:
parent
d2171b2c12
commit
be7da36681
@ -60,8 +60,9 @@ class MusicAppFactory(AppFactory):
|
||||
)
|
||||
|
||||
async def code_token(self, code: str) -> dict:
|
||||
assert self.client.user is not None
|
||||
data = {
|
||||
'client_id': '914432576926646322',
|
||||
'client_id': str(self.client.user.id),
|
||||
'client_secret': self.secret,
|
||||
'grant_type': 'authorization_code',
|
||||
'code': code,
|
||||
@ -191,7 +192,7 @@ class MusicAppFactory(AppFactory):
|
||||
return await self.html_resp('auth')
|
||||
|
||||
@routes.get('/state/')
|
||||
async def state(request: web.Request) -> web.Response:
|
||||
async def get_state(request: web.Request) -> web.Response:
|
||||
session = str(request.query.get('session'))
|
||||
return web.json_response(
|
||||
data=f'{bytes_hash(session.encode())}'
|
||||
@ -212,13 +213,13 @@ class MusicAppFactory(AppFactory):
|
||||
)
|
||||
|
||||
@routes.get('/main.js')
|
||||
async def state(_request: web.Request) -> web.Response:
|
||||
async def mainjs(_request: web.Request) -> web.Response:
|
||||
return web.Response(
|
||||
text=await self.file('main.js')
|
||||
)
|
||||
|
||||
@routes.get('/main.css')
|
||||
async def state(_request: web.Request) -> web.Response:
|
||||
async def maincss(_request: web.Request) -> web.Response:
|
||||
return web.Response(
|
||||
text=await self.file('main.css')
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user