1
0

feat: add root redirection

This commit is contained in:
オスカー、 2023-03-22 14:39:01 +00:00 committed by GitHub
parent ae4f0ce925
commit 1f99463414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

9
app.py
View File

@ -27,7 +27,8 @@ client = LinkedRolesOAuth2(
scopes=("identify", "role_connections.write"), scopes=("identify", "role_connections.write"),
state=os.getenv("COOKIE_SECRET") state=os.getenv("COOKIE_SECRET")
) )
fn = Fernet(os.getenv("ENCRYPT_KEY")) key = Fernet.generate_key()
fn = Fernet(key)
def encrypt(text: str) -> str: def encrypt(text: str) -> str:
return fn.encrypt(text.encode()) return fn.encrypt(text.encode())
@ -48,7 +49,11 @@ async def startup():
async def shutdown(): async def shutdown():
await client.close() await client.close()
@app.get('/verify') @app.get("/")
async def root():
return RedirectResponse(url="https://github.com/CloudToys/Achievement-Promotion")
@app.get("/verify")
async def link(): async def link():
steam_openid_url = "https://steamcommunity.com/openid/login" steam_openid_url = "https://steamcommunity.com/openid/login"
u = { u = {