diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93a961d..6b52b7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,4 +12,4 @@ jobs: username: ${{ secrets.USERNAME }} key: ${{ secrets.KEY }} port: 22 - script: echo "420" # cd /teaching-server/laurel/discord-bot && docker-compose down && docker-compose pull && docker-compose up -d + script: cd /teaching-server/laurel/discord-bot && docker-compose down && docker-compose pull && docker-compose up -d diff --git a/src/auth.py b/src/auth.py index 7bd9cc0..1311f05 100644 --- a/src/auth.py +++ b/src/auth.py @@ -41,7 +41,9 @@ async def logout(request: Request): request.session.clear() # logging out by logging out of all laurel services and redirect to login here return RedirectResponse( - env.laurel_logout_url + "?redirect=" + str(request.url_for("auth_login")), + env.laurel_auth_url + + "auth/logout?redirect=" + + str(request.url_for("auth_login")), ) @@ -62,5 +64,17 @@ async def remove_key(): asyncio.create_task(remove_key()) return templates.TemplateResponse( - "token.html", {"request": request, "token": token, "sub": user["sub"]} + "token.html", + { + "request": request, + "token": token, + "sub": user["sub"], + "name": user["name"], + "account_url": env.laurel_auth_url + + "?redirect=" + + str(request.url_for("auth_login")), + "logout_url": env.laurel_auth_url + + "auth/logout?redirect=" + + str(request.url_for("auth_login")), + }, ) diff --git a/src/env.py b/src/env.py index d06a2c4..76da8a2 100644 --- a/src/env.py +++ b/src/env.py @@ -7,7 +7,7 @@ class Env(BaseSettings): laurel_metadata_url: str # open id connect config laurel_client_id: str # oauth client id laurel_client_secret: str # oauth client secret - laurel_logout_url: str # logout url with ?redirect= parameter + laurel_auth_url: str # logout url with ?redirect= parameter discord_bot_token: str # discord bot secret token create_voice_channel_id: str # the id of the create voice channel channel diff --git a/templates/token.html b/templates/token.html index 7c63d89..242f5e9 100644 --- a/templates/token.html +++ b/templates/token.html @@ -1,13 +1,15 @@ - - - - UFR TF Discord Token Panel - - - -
+ + + + + UFR TF Discord Token Panel + + + + + +
+
+

+ Discord Authorization Token +

+
+
+
+
+

{{name}}

+

{{sub}}

+
+
+
+
+ {{token}} +
+ + +
+ +
+
+ + \ No newline at end of file