Skip to main content

parse_verify_token

Function parse_verify_token 

Source
pub fn parse_verify_token(json: &Value) -> Result<(), String>
Expand description

Validate a Cloudflare GET /user/tokens/verify response.

Cloudflare returns {"success": bool, "result": {"status": "active"}, ...}. The token is good iff the call succeeded and the token status is "active" (a token can verify-successfully but be disabled or expired, reported via a non-active status).