Skip to content

Commit

Permalink
Added support for multilang support for titles
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Jaeger-Freeborn <[email protected]>
  • Loading branch information
Gavinok committed Nov 18, 2024
1 parent c91cc49 commit 649e715
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions oidc-controller/api/routers/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,18 @@ async def get_authorize(request: Request, db: Database = Depends(get_db)):
"challenge_poll_uri": ChallengePollUri,
"wallet_deep_link": wallet_deep_link,
"title": (
ver_config.metadata.title
if ver_config.metadata and ver_config.metadata.title
ver_config.metadata.title.get("en")
if ver_config.metadata
and ver_config.metadata.title
and ver_config.metadata.title.get("en")
else "Scan with a Digital Wallet"
),
"claims": (
ver_config.metadata.claims
if ver_config.metadata and ver_config.metadata.claims
else {"en": []}
ver_config.metadata.claims.get("en")
if ver_config.metadata
and ver_config.metadata.claims
and ver_config.metadata.claims.get("en")
else []
),
}

Expand Down
2 changes: 1 addition & 1 deletion oidc-controller/api/templates/verified_credentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ <h5 v-if="state.showScanned" class="fw-bolder mb-3">
const mobileDevice = ref(
getBrowser() === "Android" || getBrowser() === "iOS" ? true : false
);
const claims = ref(JSON.parse('{{claims|tojson}}')['en'] ?? []);
const claims = ref(JSON.parse('{{claims|tojson}}') ?? []);

return {
mobileDevice,
Expand Down
2 changes: 1 addition & 1 deletion oidc-controller/api/verificationConfigs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class VerificationProofRequest(BaseModel):


class MetaData(BaseModel):
title: str | None = Field(default=None)
title: dict[str, str] | None = Field(default=None)
claims: dict[str, list[str]] | None = Field(default=None)


Expand Down

0 comments on commit 649e715

Please sign in to comment.