Bubble.io: How to access Local Storage plugin from Reusable Header to Log Out a user?
Options
Eben
Member ✭
I use Xano as my backend and Bubble as my frontend. Based on Michael's videos, I also use the LocalStorage Bubble plugin. I'm stuck on logging out and have a question:
I've created a reusable Header in Bubble to hold all my navigation controls so that I only need to make changes to the header in one place and have it reflected throughout my app. To log out, I want to delete the authToken stored in the LocalStorage plugin.
However, it appears I can only access the LocalStorage plugin from within a page (where I have placed a plugin) but not from the Reusable Header. This means that I can't place the logout button in the reusable header unless I manually copy and paste copies of the header on every page.
1. Here's the reusable header with the logout button[logoutButton_1.png]2. Local Storage options don't show up when I activate the workflow for the Logout button in the Reusable header.[workflowFromReusableHeader_2.png]3. However, when I use a random Logout button placed on the actual Bubble page, I see the options to delete Local Storage value. Using this option is not optimal since I would have to create a Logout button on every app page.[workflowFromPageHeader_3.png]I would prefer to have the logout button in the page header since that feels natural. I also want the header to be reusable because if it isn't, then anytime I have to make a change to the header, it means I have to go back to all those pages to update the change. Is there a workaround for this?
I've created a reusable Header in Bubble to hold all my navigation controls so that I only need to make changes to the header in one place and have it reflected throughout my app. To log out, I want to delete the authToken stored in the LocalStorage plugin.
However, it appears I can only access the LocalStorage plugin from within a page (where I have placed a plugin) but not from the Reusable Header. This means that I can't place the logout button in the reusable header unless I manually copy and paste copies of the header on every page.
1. Here's the reusable header with the logout button[logoutButton_1.png]2. Local Storage options don't show up when I activate the workflow for the Logout button in the Reusable header.[workflowFromReusableHeader_2.png]3. However, when I use a random Logout button placed on the actual Bubble page, I see the options to delete Local Storage value. Using this option is not optimal since I would have to create a Logout button on every app page.[workflowFromPageHeader_3.png]I would prefer to have the logout button in the page header since that feels natural. I also want the header to be reusable because if it isn't, then anytime I have to make a change to the header, it means I have to go back to all those pages to update the change. Is there a workaround for this?
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback