Skip to content

Commit

Permalink
feat: allow to set a custom name for the csrf cookie (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Aug 7, 2024
1 parent 9db2be1 commit 21a6158
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions poem/src/middleware/csrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ impl Csrf {
Default::default()
}

/// Sets the name of the csrf cookie. Default is `poem-csrf-token`.
#[must_use]
pub fn cookie_name(self, cookie_name: String) -> Self {
Self { cookie_name, ..self }
}

/// Sets AES256 key to provide signed, encrypted CSRF tokens and cookies.
#[must_use]
pub fn key(self, key: [u8; 32]) -> Self {
Expand Down

0 comments on commit 21a6158

Please sign in to comment.