Repository: ramosbugs/oauth2-rs (language: rust)

Issue:
Comments in examples mention csrf_state which does not exist in the code
https://docs.rs/oauth2/4.3.0/oauth2/index.html#example-synchronous-blocking-api

```
// Once the user has been redirected to the redirect URL, you'll have access to the
// authorization code. For security reasons, your code should verify that the `state`
// parameter returned by the server matches `csrf_state`.
```

Presumably this is meant to refer to csrf_token which is set in the code above that comment?

The same issue occurs several times in later examples.


Discussion / hints:
Yup, nice catch. The variable is named `csrf_state` in some of the [other examples](https://github.com/ramosbugs/oauth2-rs/blob/00fa30b336a8b3c9c4c900ae3ccba371459c0ac8/examples/google.rs#L64), but this comment must have become stale at some point.

Fix patch:
diff --git a/src/lib.rs b/src/lib.rs
index 10a17be..0e9aa13 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -131,7 +131,7 @@
 //!
 //! // Once the user has been redirected to the redirect URL, you'll have access to the
 //! // authorization code. For security reasons, your code should verify that the `state`
-//! // parameter returned by the server matches `csrf_state`.
+//! // parameter returned by the server matches `csrf_token`.
 //!
 //! // Now you can trade it for an access token.
 //! let token_result =
@@ -202,7 +202,7 @@
 //!
 //! // Once the user has been redirected to the redirect URL, you'll have access to the
 //! // authorization code. For security reasons, your code should verify that the `state`
-//! // parameter returned by the server matches `csrf_state`.
+//! // parameter returned by the server matches `csrf_token`.
 //!
 //! // Now you can trade it for an access token.
 //! let token_result = client
@@ -259,7 +259,7 @@
 //!
 //! // Once the user has been redirected to the redirect URL, you'll have the access code.
 //! // For security reasons, your code should verify that the `state` parameter returned by the
-//! // server matches `csrf_state`.
+//! // server matches `csrf_token`.
 //!
 //! # Ok(())
 //! # }


Test patch: