Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/nsls2api/api/v1/user_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

import fastapi
from fastapi import HTTPException, Request
from fastapi import HTTPException, Request, Header

from nsls2api.api.models.person_model import DataSessionAccess, LDAPUserResponse, Person
from nsls2api.infrastructure.security import get_settings
Expand Down Expand Up @@ -74,9 +74,8 @@ async def get_person_by_department(department_code: str = "PS"):

# TODO: Add back into schema if we decide to use this endpoint.
@router.get("/person/me",include_in_schema=True)
async def get_myself(request: Request, upn: str= None):
#User principal name
upn = upn or request.headers.get("upn")
async def get_myself(upn: str = Header(...)):
#upn: User principal name
if not upn:
raise HTTPException(status_code=400, detail = "upn not found")
settings = get_settings()
Expand Down