Skip to content

Commit

Permalink
update user/me
Browse files Browse the repository at this point in the history
  • Loading branch information
Puzanovim committed May 29, 2021
1 parent 2c2bf9f commit cfc6fe6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/users/routes.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from fastapi import Depends, Response
from fastapi import APIRouter

from .schemas import UserDB
from ..config import SECRET

from src.users.logic import jwt_authentication, all_users, \
on_after_forgot_password, on_after_reset_password, after_verification, after_verification_request
on_after_forgot_password, on_after_reset_password, after_verification, after_verification_request, any_user

router = APIRouter()

Expand All @@ -13,6 +15,13 @@ async def refresh_jwt(response: Response, user=Depends(all_users.get_current_act
return await jwt_authentication.get_login_response(user, response)


@router.get("/me", response_model=UserDB)
async def me(
user: UserDB = Depends(any_user), # type: ignore
):
return user


router.include_router(
all_users.get_auth_router(jwt_authentication),
prefix="/auth/jwt",
Expand All @@ -28,10 +37,11 @@ async def refresh_jwt(response: Response, user=Depends(all_users.get_current_act
after_reset_password=on_after_reset_password),
prefix="/auth",
tags=["auth"])
router.include_router(
all_users.get_users_router(),
prefix="/users",
tags=["users"])
# router.include_router(
# all_users.get_users_router(),
# prefix="/users",
# tags=["users"])

router.include_router(
all_users.get_verify_router(
SECRET,
Expand Down

0 comments on commit cfc6fe6

Please sign in to comment.