mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 11:59:26 +00:00
fix: add debug labels
This commit is contained in:
parent
3b85a73ec1
commit
c5bb590b2d
4 changed files with 23 additions and 6 deletions
|
|
@ -9,7 +9,9 @@ export const HeaderProfileBox = () => {
|
|||
return (
|
||||
<ProfileArea>
|
||||
{" "}
|
||||
<span>HeaderProfileBox {String(auth.isAuthenticated)}</span>{" "}
|
||||
<span>
|
||||
HeaderProfileBox <br /> isLogged : {String(auth.isAuthenticated)} <br /> user : {String(auth.userInfo.username)}
|
||||
</span>{" "}
|
||||
<UnidentifiedArea>
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -41,7 +43,8 @@ const ProfileArea = styled.div`
|
|||
padding: 6px;
|
||||
font-size: 12px;
|
||||
margin: 3px;
|
||||
background-color: #19191939;
|
||||
// blur
|
||||
background-color: #19191960;
|
||||
border-radius: 5px;
|
||||
color: white;
|
||||
width: auto;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,26 @@
|
|||
import React from "react";
|
||||
import { Menu } from "./elements/menu";
|
||||
import Link from 'next/link'
|
||||
import styled from "styled-components";
|
||||
|
||||
|
||||
export const Header = () => {
|
||||
return (
|
||||
<div>
|
||||
<Menu></Menu>
|
||||
<PreAlphaLabel>🚧 Pre-Alpha</PreAlphaLabel>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const PreAlphaLabel = styled.div`
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
padding: 9px;
|
||||
background-color: #080501;
|
||||
color: white;
|
||||
font-size: 19px;
|
||||
font-weight: bold;
|
||||
border-radius: 5px 0 0 0px;
|
||||
`;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from pydantic import BaseModel
|
|||
from src.services.auth import *
|
||||
from src.services.users import *
|
||||
|
||||
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/auth/token")
|
||||
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
|
@ -18,7 +18,7 @@ async def api_get_current_user(current_user: User = Depends(get_current_user)):
|
|||
return current_user.dict()
|
||||
|
||||
@router.get("/profile")
|
||||
async def api_get_current_user(current_user: User = Depends(get_current_user_jwt)):
|
||||
async def api_get_current_user(current_user: User = Depends(get_current_user)):
|
||||
"""
|
||||
Get current user
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ def create_access_token(data: dict, expires_delta: timedelta | None = None):
|
|||
return encoded_jwt
|
||||
|
||||
# DEPRECATED
|
||||
async def get_current_user(token: str = Depends(oauth2_scheme)):
|
||||
async def get_current_user_old(token: str = Depends(oauth2_scheme)):
|
||||
credentials_exception = HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Could not validate credentials",
|
||||
|
|
@ -82,7 +82,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
|
|||
return PublicUser(**user.dict())
|
||||
|
||||
|
||||
async def get_current_user_jwt(Authorize: AuthJWT = Depends()):
|
||||
async def get_current_user(Authorize: AuthJWT = Depends()):
|
||||
credentials_exception = HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Could not validate credentials",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue