Skip to content

Commit

Permalink
fix auth for deployment domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrauscher committed Feb 26, 2024
1 parent edeeb4a commit cd7ff89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file added src/api/favicon.ico
Binary file not shown.
5 changes: 3 additions & 2 deletions src/api/routes/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os
from urllib.parse import urlparse

import requests
from fastapi import APIRouter, HTTPException, Request
Expand Down Expand Up @@ -38,7 +39,7 @@ async def login_via_stockx(state: str, request: Request):


@router.get("/stockx/callback")
async def stockx_oauth_callback(state: str = None, code: str = None):
async def stockx_oauth_callback(state: str, code: str, request: Request):
if code is None:
raise HTTPException(status_code=400, detail="No code returned from StockX.")
if state != "YTPc2DqAwnmhHGzSQVtzwEPq2eEgprUi":
Expand All @@ -52,7 +53,7 @@ async def stockx_oauth_callback(state: str = None, code: str = None):
"client_id": STOCKX_CLIENT_ID,
"client_secret": STOCKX_CLIENT_SECRET,
"code": code,
"redirect_uri": "https://localhost:8000",
"redirect_uri": f"https://{urlparse(request.url_for("get_sneakers")).netloc}",
}
tokens = (
session.post(
Expand Down

0 comments on commit cd7ff89

Please sign in to comment.