actix / actix-extras

A collection of additional crates supporting the actix and actix-web frameworks.
https://actix.rs
Apache License 2.0
787 stars 206 forks source link

Add the ability to change the keys #348

Closed dgagn closed 9 months ago

dgagn commented 1 year ago

PR Type

Feature

PR Checklist

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 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.

AprilNEA commented 1 year ago

I think this would be very useful for me and hopefully it will get moved forward soon.