diff --git a/oidc-controller/api/authSessions/models.py b/oidc-controller/api/authSessions/models.py index 8e10ec6d..c8fdc257 100644 --- a/oidc-controller/api/authSessions/models.py +++ b/oidc-controller/api/authSessions/models.py @@ -15,6 +15,7 @@ class AuthSessionState(StrEnum): EXPIRED = auto() VERIFIED = auto() FAILED = auto() + ABANDONED = auto() class AuthSessionBase(BaseModel): pres_exch_id: str diff --git a/oidc-controller/api/routers/acapy_handler.py b/oidc-controller/api/routers/acapy_handler.py index b53ff642..53a06737 100644 --- a/oidc-controller/api/routers/acapy_handler.py +++ b/oidc-controller/api/routers/acapy_handler.py @@ -61,6 +61,16 @@ async def post_topic(request: Request, topic: str, db: Database = Depends(get_db await AuthSessionCRUD(db).patch( str(auth_session.id), AuthSessionPatch(**auth_session.dict()) ) + + # abandoned state + if webhook_body["state"] == "abandoned": + logger.info("ABANDONED") + logger.info(webhook_body["error_msg"]) + auth_session.proof_status = AuthSessionState.ABANDONED + await sio.emit("status", {"status": "abandoned"}, to=sid) + await AuthSessionCRUD(db).patch( + str(auth_session.id), AuthSessionPatch(**auth_session.dict()) + ) # Calcuate the expiration time of the proof now_time = datetime.now() diff --git a/oidc-controller/api/templates/verified_credentials.html b/oidc-controller/api/templates/verified_credentials.html index 38a667d8..c1075fbf 100644 --- a/oidc-controller/api/templates/verified_credentials.html +++ b/oidc-controller/api/templates/verified_credentials.html @@ -136,6 +136,7 @@ .header-desc.success, .header-desc.pending, .header-desc.expired, + .header-desc.abandoned, .header-desc.failed { display: none; border-radius: 0.5rem; @@ -166,6 +167,9 @@ .header-desc.success { background-color: #dff0d8; } + .header-desc.abandoned { + background-color: #f2dede; + } .header-desc a { line-height: 1rem; } @@ -216,6 +220,18 @@