Restrict access to authenticated-only features - #6
Conversation
- Implement ProtectedRoute in main.tsx for history, settings, and collection. - Update Shell.tsx to use server-side identity (user.getSelf) for navigation visibility. - Add context-specific login CTAs to Store and Play pages. - Clear invalid login tokens from localStorage on startup. - Update RegisterButton to support custom labels. Co-authored-by: MasterGordon <18127395+MasterGordon@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
I have implemented several changes to ensure that parts of the application intended for logged-in users are properly restricted and provide clear "Call to Action" (CTA) points for guests.
Key changes:
ProtectedRoutecomponent insrc/main.tsxthat gates access to/history,/settings, and/collection. Guests are now met with a friendly login message and CTA.Shell.tsxto use the authenticated username from the server to determine which navigation links to show, replacing the less reliable local token check.RegisterButtonto accept alabelprop for these custom CTAs.src/main.tsxto automatically remove theloginTokenfromlocalStorageif it's found to be invalid or expired during initial connection.PR created automatically by Jules for task 2097218213544781789 started by @MasterGordon