feat: self-service change password for all roles
- middleware.ts: add /account to isSharedRoute so all roles can reach it
- components/account/change-password-form.tsx: re-auth with current password
then updateUser({password}) with client-side validation (length, match, diff)
- app/(protected)/account/page.tsx: dedicated account page, no role gate
- sidebar.tsx: Account link (all roles) above Logout in desktop footer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CPf5Rc8QPx6V8KLEEgfKEQ
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ export async function middleware(request: NextRequest) {
|
||||
const { data: { user } } = await supabase.auth.getUser()
|
||||
const { pathname } = request.nextUrl
|
||||
const isPublicRoute = pathname.startsWith('/login') || pathname.startsWith('/auth') || pathname.startsWith('/api/cron')
|
||||
const isSharedRoute = pathname.startsWith('/report')
|
||||
const isSharedRoute = pathname.startsWith('/report') || pathname.startsWith('/account')
|
||||
|
||||
if (!user && !isPublicRoute) {
|
||||
const redirectUrl = request.nextUrl.clone()
|
||||
|
||||
Reference in New Issue
Block a user