Skip to main content

userinfo

Function userinfo 

Source
pub async fn userinfo(
    __arg0: State<ApiState>,
    headers: HeaderMap,
) -> ApiResponse<UserInfoResponse>
Expand description

GET /api/v1/oauth/userinfo โ€” return claims about the authenticated user.

The caller must supply a valid Bearer access token. If the token has been revoked, an invalid_token error is returned. Email is included only when the email scope is present in the token.

ยงExample

โ“˜
// GET /api/v1/oauth/userinfo  Authorization: Bearer <token>
let resp = userinfo(State(state), headers).await;
assert_eq!(resp.data.unwrap().sub, "user-1");