Skip to content

Commit

Permalink
allow oidc id key to be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobfilik committed Aug 15, 2024
1 parent 4c8d8ff commit 9c7eb64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion xas-standards-api/src/xas_standards_api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
get_bearer_token = HTTPBearer(auto_error=True)

oidc_user_info_endpoint = os.environ.get("OIDC_USER_INFO_ENDPOINT")
oidc_id_key= os.environ.get("OIDC_ID_KEY", "id")
dev = False

env_value = os.environ.get("FASTAPI_APP_ENV")
Expand Down Expand Up @@ -50,4 +51,4 @@ async def get_current_user(
detail="Invalid user token",
)

return response.json()["id"]
return response.json()[oidc_id_key]
2 changes: 1 addition & 1 deletion xas-standards-client/src/components/review/ReviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function ReviewPage() {

function getData() {
return (id: number) => {
axios.get(data_url + "/" + id + "/?format=json").then((response) => {
axios.get(data_url + "/" + id + "?format=json").then((response) => {
const output: XASData = response.data as XASData;
const containsTrans = output != null && output.mutrans.length != 0;
const containsFluor = output != null && output.mufluor.length != 0;
Expand Down

0 comments on commit 9c7eb64

Please sign in to comment.