[x] Tests for the changes have been added / updated.
[x] Documentation comments have been added / updated.
[ ] A changelog entry has been made for the appropriate packages.
[x] Format code with the nightly rustfmt (cargo +nightly fmt).
Overview
Current Behavior:
The IdentityMiddleware uses hardcoded strings as session keys for user identity and timestamps. These keys are:
"actix_identity.user_id"
"actix_identity.last_visited_at"
"actix_identity.logged_in_at"
New behavior:
The IdentityMiddleware now provides configuration options to allow users to set custom session keys for user identity and timestamps. These keys can be set via the IdentityMiddlewareBuilder and are stored in the Configuration struct. The default values remain the same as the original hardcoded strings.
While the default behavior remains the same, users who are extending or interacting directly with the Configuration struct or the IdentityMiddlewareBuilder might need to adjust their code to accommodate the new fields for custom session keys.
PR Type
Feature
PR Checklist
cargo +nightly fmt
).Overview
Current Behavior: The
IdentityMiddleware
uses hardcoded strings as session keys for user identity and timestamps. These keys are:New behavior: The
IdentityMiddleware
now provides configuration options to allow users to set custom session keys for user identity and timestamps. These keys can be set via theIdentityMiddlewareBuilder
and are stored in theConfiguration
struct. The default values remain the same as the original hardcoded strings.While the default behavior remains the same, users who are extending or interacting directly with the
Configuration
struct or theIdentityMiddlewareBuilder
might need to adjust their code to accommodate the new fields for custom session keys.