A shared folder with AI prompts and code snippets
From workspace: Bolt
Team: Main
Total snippets: 6
6 snippets
Display a spinner or skeleton UI while checking authentication.
Add a loading spinner while checking user authentication state. Include: – Show spinner or placeholder UI – Replace with content after auth loads – Avoid flash of unprotected content
Prevent unauthenticated users from accessing certain routes.
Protect the dashboard and profile routes from unauthorized users. Include: – Redirect to login if user not authenticated – Use middleware or wrapper component – Show loading state during auth check
Add a logout button that clears user session and redirects to login.
Add a logout button to the user dropdown menu. Include: – Clear session or token – Redirect to login page after logout – Optional confirmation modal
Display current user data like name or email in the UI after login.
Show current authenticated user’s name and email in the header bar. Include: – Pull from auth context or provider – Handle missing/null values – Make layout responsive
Allow users to sign in using Google OAuth with a clear flow.
Add Google OAuth sign-in to the login screen. Include: – Use OAuth button with Google branding – Handle token on success – Show loading and error states
Create a password reset flow with email-based recovery.
Create a password reset feature for users who forgot their password. Include: – Email input for requesting reset – Success message if email sent – Handle token and set new password