Skip to content
Clone

refactor(user): refresh sessions list_sessions handler

zhenyi committed
parent 3cda7d3 commit fc09905 Browse files

1 file changed

+4 −4

Modified lib/user/handler/sessions/list_sessions.rs View lib/user/handler/sessions/list_sessions.rs
@@ -1,5 +1,5 @@
1use axum::Json;
21use axum::extract::{Query, State};
2use export::data::AppResponseData;
33use jwt::extractor::AuthUser;
44
55use crate::error::UserResult;
@@ -15,7 +15,7 @@
1515 ("include_revoked" = Option<bool>, Query, description = "Include revoked sessions (default false)."),
1616 ),
1717 responses(
18 (status = 200, description = "List active sessions for the caller.", body = Vec<SessionView>),
18 (status = 200, description = "List active sessions for the caller.", body = AppResponseData<Vec<SessionView>>),
1919 ),
2020 security(("bearer_auth" = [])),
2121)]
@@ -23,6 +23,6 @@
2323 State(svc): State<UserService>,
2424 AuthUser { claims }: AuthUser,
2525 Query(q): Query<ListSessionsQuery>,
26) -> UserResult<Json<Vec<SessionView>>> {
27 Ok(Json(svc.list_sessions(claims.sub, q).await?))
26) -> UserResult<AppResponseData<Vec<SessionView>>> {
27 Ok(AppResponseData::ok(svc.list_sessions(claims.sub, q).await?))
2828}
No newline at end of file