Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
zopyx committed Jun 2, 2024
1 parent e03bd61 commit 7044367
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions fastapi_auth/auth_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class AuthConfig(BaseSettings):
secret_key: SecretStr = DEFAULT_KEY
db_uri: str = DEFAULT_DB_URI
log_filename: str = "fastpi_auth.log"

class Config:
env_prefix = "AUTH_"
Expand Down
4 changes: 2 additions & 2 deletions fastapi_auth/auth_routes.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Optional

from fastapi import Depends, Form, Request, APIRouter
from fastapi import Depends, Request, APIRouter
from fastapi.responses import HTMLResponse, RedirectResponse
from starlette import status

from .dependencies import get_user
from .logger import LOG
from .users import User, ANONYMOUS_USER
from .user_management_sqlobject import get_user_from_fastapi_request, authenticate_user_for_fastapi
from .user_management_sqlobject import authenticate_user_for_fastapi
from .jinja2_templates import templates

from starlette.middleware.sessions import SessionMiddleware
Expand Down
8 changes: 7 additions & 1 deletion fastapi_auth/logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from loguru import logger as LOG # noqa

LOG.add("fastapi-auth.log", level="DEBUG", retention="10 days")
from .auth_config import AUTH_SETTINGS

LOG.add(
AUTH_SETTINGS.log_filename,
level="DEBUG",
retention="10 days",
)

0 comments on commit 7044367

Please sign in to comment.