configurable redirect
This commit is contained in:
parent
54a9bb447f
commit
6b4c8aa8fa
@ -15,6 +15,7 @@ __all__ = ("AppContext",)
|
|||||||
class MusicAppFactory(AppFactory):
|
class MusicAppFactory(AppFactory):
|
||||||
def __init__(self, secret: str, api: Api):
|
def __init__(self, secret: str, api: Api):
|
||||||
self.secret = secret
|
self.secret = secret
|
||||||
|
self.redirect = "https://music.parrrate.ru/auth/"
|
||||||
self.loop = asyncio.get_running_loop()
|
self.loop = asyncio.get_running_loop()
|
||||||
self._api = api
|
self._api = api
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ class AppContext:
|
|||||||
try:
|
try:
|
||||||
factory = MusicAppFactory(await request_token("music-client", "token"), self.api)
|
factory = MusicAppFactory(await request_token("music-client", "token"), self.api)
|
||||||
await set_config("secret", factory.secret)
|
await set_config("secret", factory.secret)
|
||||||
|
await set_config("redirect", factory.redirect)
|
||||||
except aiohttp.ClientConnectorError:
|
except aiohttp.ClientConnectorError:
|
||||||
print("no web app (likely due to no token)")
|
print("no web app (likely due to no token)")
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user