Skip to content

Commit

Permalink
Merge pull request #212 from davidbrochart/token
Browse files Browse the repository at this point in the history
Open browser window with token as query parameter
  • Loading branch information
davidbrochart committed Aug 30, 2022
2 parents 96a97ae + 8f45680 commit 1ddb5ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions plugins/auth/fps_auth/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from fps.config import get_config # type: ignore
from fps.hooks import register_router # type: ignore
from fps.logging import get_configured_logger # type: ignore
from fps_uvicorn.cli import add_query_params # type: ignore
from fps_uvicorn.config import UvicornConfig # type: ignore
from sqlalchemy import select # type: ignore

Expand All @@ -30,7 +31,9 @@

logger = get_configured_logger("auth")

uvicorn_config = get_config(UvicornConfig)
auth_config = get_auth_config()
if auth_config.mode == "token":
add_query_params({"token": auth_config.token})

router = APIRouter()

Expand Down Expand Up @@ -67,8 +70,6 @@ async def get_user_by_email(user_email):
async def startup():
await create_db_and_tables()

auth_config = get_auth_config()

if auth_config.test:
try:
await create_user(
Expand Down Expand Up @@ -96,6 +97,7 @@ async def startup():
)

if auth_config.mode == "token":
uvicorn_config = get_config(UvicornConfig)
logger.info("")
logger.info("To access the server, copy and paste this URL:")
logger.info(
Expand Down
2 changes: 1 addition & 1 deletion plugins/auth/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ packages = find:
python_requires = >=3.7

install_requires =
fps >=0.0.8
fps[uvicorn] >=0.0.17
fps-lab
aiosqlite
fastapi-users[sqlalchemy,oauth] >=10.1.4,<11
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package_dir =
python_requires = >=3.7

install_requires =
fps[uvicorn] >=0.0.10
fps[uvicorn] >=0.0.17
fps-login
fps-auth
fps-contents
Expand Down

0 comments on commit 1ddb5ce

Please sign in to comment.