You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tutorial on Sessions gives a suggestion on how to write a custom storage provider with Redis. It suggests that you convert from JSON to Hashtable (ConvertFrom-Json -AsHashTable). However, it doesn't call out that the Data.Auth.User object actually NEEDS to be an object in order for the user session to work properly (such as displaying the username in the header of the site).
I wrote my own in-memory provider and it worked fine. But when trying to roundtrip to JSON in Azure Tables or even in my in-memory provider (both with -AsHashTable), the session would work but the username wouldn't appear in the app header.
I would suggest editing the example and adding a paragraph about how the User property in the hashtable MUST be a PSObject. I will go file a PR as a first pass.
Workaround
I am able to get my project working via: $s.Data.Data.Auth.User = [PSCustomObject]$s.Data.Data.Auth.User
The text was updated successfully, but these errors were encountered:
Describe the Change
The tutorial on Sessions gives a suggestion on how to write a custom storage provider with Redis. It suggests that you convert from JSON to Hashtable (
ConvertFrom-Json -AsHashTable
). However, it doesn't call out that the Data.Auth.User object actually NEEDS to be an object in order for the user session to work properly (such as displaying the username in the header of the site).https://github.com/Badgerati/Pode/blob/develop/docs/Tutorials/Middleware/Types/Sessions.md#storage
I wrote my own in-memory provider and it worked fine. But when trying to roundtrip to JSON in Azure Tables or even in my in-memory provider (both with -AsHashTable), the session would work but the username wouldn't appear in the app header.
From this code, I determined the cause:
Additional Context
I would suggest editing the example and adding a paragraph about how the User property in the hashtable MUST be a PSObject. I will go file a PR as a first pass.
Workaround
I am able to get my project working via:
$s.Data.Data.Auth.User = [PSCustomObject]$s.Data.Data.Auth.User
The text was updated successfully, but these errors were encountered: