feat(auth): harden session management and security
- Implement server-side session revocation on logout - Add IP extraction utility and admin setup error handling - Improve error codes and response consistency for auth endpoints - Refine landing page redirect logic to handle transient DB outages - Update deployment documentation and configuration defaults
This commit is contained in:
1 parent
935f12a1e9
commit
89e4d68690
81 files changed
+11530
-6916
No files matched your search
@@ -188,9 +188,24 @@ export async function POST(req: NextRequest) {
|
||||
|
||||
await SettingsManager.updateSettingsAsync(validated);
|
||||
const settings = await SettingsManager.getPublicSettingsAsync();
|
||||
const bridgeSync = SettingsManager.getLastBridgeSyncStatus();
|
||||
return NextResponse.json({
|
||||
settings,
|
||||
success: true,
|
||||
...(bridgeSync
|
||||
? {
|
||||
bridgeSync: {
|
||||
attempted: bridgeSync.attempted ?? true,
|
||||
ok: bridgeSync.ok ?? bridgeSync.synced,
|
||||
synced: bridgeSync.synced,
|
||||
...(bridgeSync.status !== undefined
|
||||
? { status: bridgeSync.status }
|
||||
: {}),
|
||||
...(bridgeSync.error ? { error: bridgeSync.error } : {}),
|
||||
checkedAt: bridgeSync.checkedAt,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
} catch (err: unknown) {
|
||||
const message =
|
||||
|
||||
Reference in new issue
Block a user