Skip to content

Commit

Permalink
feat: login read from query
Browse files Browse the repository at this point in the history
  • Loading branch information
dartt0n committed Jul 23, 2024
1 parent 6b88371 commit 9e87135
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@


async def notify_start():
version = os.getenv("APP_VERSION", "dev")
if version == "dev":
version = os.getenv("APP_VERSION", None)
log.info(f"version: {version}")
if version is None or version == "dev":
return

token = os.getenv("STATUS_TELEGRAM_BOT_TOKEN")
if token is None:
return
log.info("status token is present")

chat = os.getenv("STATUS_CHAT_ID")
if chat is None:
return
log.info("status chat id is present")

url = f"https://api.telegram.org/bot{token}/sendMessage"

Expand All @@ -48,6 +51,8 @@ async def notify_start():
resp.raise_for_status()
except Exception as e:
log.error("failed to notify about start: {}", e)
else:
log.info("successfully notified about start")


async def app():
Expand Down
2 changes: 1 addition & 1 deletion src/app/http/routes/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def register_handler(self, request: web.Request) -> web.Response:

async def login_handler(self, request: web.Request) -> web.Response:
try:
payload = await request.json()
payload = request.query

container = await self._oauth_adapter.login(payload)
except UserNotFoundException:
Expand Down

0 comments on commit 9e87135

Please sign in to comment.