Skip to content

Commit

Permalink
hot-fix resolve auth issues
Browse files Browse the repository at this point in the history
  • Loading branch information
russbiggs committed Sep 15, 2023
1 parent 0082237 commit b20ceba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openaq_api/openaq_api/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ async def check_email(request: Request):
@router.get("/verify/{verification_code}")
async def verify(request: Request, verification_code: str, db: DB = Depends()):
query = """
SELECT
SELECT
users.users_id, users.is_active, users.expires_on, entities.full_name, users.email_address
FROM
FROM
users
JOIN
users_entities USING (users_id)
JOIN
JOIN
entities USING (entities_id)
WHERE
verification_code = :verification_code
Expand Down Expand Up @@ -209,8 +209,8 @@ async def verify(request: Request, verification_code: str, db: DB = Depends()):
else:
try:
token = await db.get_user_token(row[0])
if request.app.state.redis_client:
redis_client = request.app.state.redis_client
redis_client = getattr(request.app.state, "redis_client")
if redis_client:
await redis_client.sadd("keys", token)
send_api_key_email(token, row[3], row[4])
except Exception as e:
Expand Down

0 comments on commit b20ceba

Please sign in to comment.