From 23646f16388f105efd617dbf716456b22289353e Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sun, 13 Apr 2025 02:42:11 +0200 Subject: [PATCH] Add profile_handler function to handle user profile requests --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6ceeec2..cf03a16 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,13 @@ impl Hooks for App { ```rust use loco_keycloak_auth::Keycloak; +pub async fn profile_handler( + State(_ctx): State, + Extension(token): Extension>, +) -> Result { + format::json(token.subject) +} + fn routes(ctx: &AppContext) -> Routes { let keycloak = Keycloak::from_context(ctx).expect("Failed to create Keycloak layer");