[PR #2274] [MERGED] fix: fix 5xx due to missing auth checks on settings layout #2041

Closed
opened 2026-03-02 12:00:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/2274
Author: @MohamedBassem
Created: 12/20/2025
Status: Merged
Merged: 12/20/2025
Merged by: @MohamedBassem

Base: mainHead: claude/fix-settings-auth-checks-jgyD8


📝 Commits (1)

  • 624c2bc fix: add authentication checks to settings layout

📊 Changes

1 file changed (+24 additions, -2 deletions)

View changed files

📝 apps/web/app/settings/layout.tsx (+24 -2)

📄 Description

The settings layout was missing authentication checks, causing server errors when unauthenticated users tried to access any settings page. This fix adds:

  • Session verification via getServerAuthSession()
  • Redirect to "/" if no session exists
  • Proper error handling with tryCatch wrapper
  • Redirect to "/logout" for NOT_FOUND or UNAUTHORIZED errors

This brings the settings layout in line with the auth patterns used in dashboard, admin, and reader layouts.

Fixes #2242


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/2274 **Author:** [@MohamedBassem](https://github.com/MohamedBassem) **Created:** 12/20/2025 **Status:** ✅ Merged **Merged:** 12/20/2025 **Merged by:** [@MohamedBassem](https://github.com/MohamedBassem) **Base:** `main` ← **Head:** `claude/fix-settings-auth-checks-jgyD8` --- ### 📝 Commits (1) - [`624c2bc`](https://github.com/karakeep-app/karakeep/commit/624c2bcde8b516624a47c6b136912ff54f51a50d) fix: add authentication checks to settings layout ### 📊 Changes **1 file changed** (+24 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/app/settings/layout.tsx` (+24 -2) </details> ### 📄 Description The settings layout was missing authentication checks, causing server errors when unauthenticated users tried to access any settings page. This fix adds: - Session verification via getServerAuthSession() - Redirect to "/" if no session exists - Proper error handling with tryCatch wrapper - Redirect to "/logout" for NOT_FOUND or UNAUTHORIZED errors This brings the settings layout in line with the auth patterns used in dashboard, admin, and reader layouts. Fixes #2242 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 12:00:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#2041
No description provided.