Function
current
(auth: auth::JWT, State(ctx): State<AppContext>)
Source from the content-addressed store, hash-verified
| 5 | |
| 6 | #[debug_handler] |
| 7 | async fn current(auth: auth::JWT, State(ctx): State<AppContext>) -> Result<Response> { |
| 8 | let user = users::Model::find_by_pid(&ctx.db, &auth.claims.pid).await?; |
| 9 | format::json(CurrentResponse::new(&user)) |
| 10 | } |
| 11 | |
| 12 | pub fn routes() -> Routes { |
| 13 | Routes::new().prefix("user").add("/current", get(current)) |
Callers
nothing calls this directly
Tested by
no test coverage detected