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