How to properly use SharedPreferences after ClientStorage removal in Flet 0.80.0? #5973
Unanswered
gt-diego-pizarro
asked this question in
Q&A
Replies: 3 comments 4 replies
-
|
See docs example: https://docs.flet.dev/services/sharedpreferences/ |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Do you really store OpenID client_secret on your device for everyone to see? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
There is indeed an issue with using SharedPreferences in on_login handler. Looking into this. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hi everyone 👋
I’m looking for some guidance after upgrading my project to Flet v0.80.0.
I have a Flet app that uses Auth0 for authentication and stores the user token persistently using SharedPreferences. Before the upgrade, I was using
ClientStorage, but after updating Flet I had to migrate everything toSharedPreferences, and that’s where my logic started to break.Now I’m getting errors like this when trying to save the token:
From what I understand,
SharedPreferencesis now treated as a control that must be attached to the page, but I’m not fully sure what the correct or recommended pattern is to manage it across my app.My questions are:
SharedPreferencesbe properly initialized and attached to the page?main(page)) and then passed around?auth_servicewithout tightly coupling everything to the page?If anyone has a working example or can point me to the right pattern after the
ClientStorage→SharedPreferencesmigration, I’d really appreciate it 🙏Thanks in advance!
Code sample
Error message
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions