Skip to content

Commit bf6b9fb

Browse files
author
Ike McCreery
committed
Fix comments about csrf_state
Clarify that the `state` parameter should be compared to the `csrf_token.secret()`. Fixes #208.
1 parent e24e255 commit bf6b9fb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
//!
132132
//! // Once the user has been redirected to the redirect URL, you'll have access to the
133133
//! // authorization code. For security reasons, your code should verify that the `state`
134-
//! // parameter returned by the server matches `csrf_state`.
134+
//! // parameter returned by the server matches `csrf_token.secret()`.
135135
//!
136136
//! // Now you can trade it for an access token.
137137
//! let token_result =
@@ -202,7 +202,7 @@
202202
//!
203203
//! // Once the user has been redirected to the redirect URL, you'll have access to the
204204
//! // authorization code. For security reasons, your code should verify that the `state`
205-
//! // parameter returned by the server matches `csrf_state`.
205+
//! // parameter returned by the server matches `csrf_token.secret()`.
206206
//!
207207
//! // Now you can trade it for an access token.
208208
//! let token_result = client
@@ -259,7 +259,7 @@
259259
//!
260260
//! // Once the user has been redirected to the redirect URL, you'll have the access code.
261261
//! // For security reasons, your code should verify that the `state` parameter returned by the
262-
//! // server matches `csrf_state`.
262+
//! // server matches `csrf_token.secret()`.
263263
//!
264264
//! # Ok(())
265265
//! # }

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ new_secret_type![
594594
new_secret_type![
595595
///
596596
/// Value used for [CSRF](https://tools.ietf.org/html/rfc6749#section-10.12) protection
597-
/// via the `state` parameter.
597+
/// via the `state` parameter. Compare the `state` parameter to `self.secret()`.
598598
///
599599
#[must_use]
600600
#[derive(Clone, Deserialize, Serialize)]

0 commit comments

Comments
 (0)