fix compact reader auth control
This commit is contained in:
parent
5eef2eac37
commit
29d770941a
3 changed files with 18 additions and 16 deletions
|
|
@ -10,7 +10,6 @@ import { fetchWorkerOperationState } from '@/lib/server/compute/worker-op-state'
|
|||
import { isValidDocumentId } from '@/lib/server/documents/blobstore';
|
||||
import { normalizeParseStatus, parseDocumentParseState } from '@/lib/server/documents/parse-state';
|
||||
import { healStaleDocumentParseState } from '@/lib/server/documents/parse-state-healing';
|
||||
import { getOpenReaderTestNamespace } from '@/lib/server/testing/test-namespace';
|
||||
import { isS3Configured } from '@/lib/server/storage/s3';
|
||||
import { createRequestLogger, hashForLog } from '@/lib/server/logger';
|
||||
import { errorResponse } from '@/lib/server/errors/next-response';
|
||||
|
|
@ -159,7 +158,6 @@ export async function GET(req: NextRequest, ctx: { params: Promise<{ id: string
|
|||
? requestedOpIdRaw.trim()
|
||||
: null;
|
||||
|
||||
const testNamespace = getOpenReaderTestNamespace(req.headers);
|
||||
const storageUserId = authCtxOrRes.userId;
|
||||
const storageUserIdHash = hashForLog(storageUserId);
|
||||
const allowedUserIds = [storageUserId];
|
||||
|
|
|
|||
|
|
@ -1252,18 +1252,20 @@ export function SettingsModal({
|
|||
Disconnect account
|
||||
</Button>
|
||||
|
||||
<div className="pt-4 mt-4 border-t border-line-soft">
|
||||
<label className="block text-sm font-medium text-danger mb-2">Danger Zone</label>
|
||||
<Button
|
||||
onClick={() => setShowDeleteAccountConfirm(true)}
|
||||
className={buttonClass({ variant: 'danger', size: 'md' })}
|
||||
>
|
||||
Delete Account
|
||||
</Button>
|
||||
<p className="text-xs text-soft mt-2">
|
||||
Permanently deletes your account and all data.
|
||||
</p>
|
||||
</div>
|
||||
{enableDestructiveDelete && (
|
||||
<div className="pt-4 mt-4 border-t border-line-soft">
|
||||
<label className="block text-sm font-medium text-danger mb-2">Danger Zone</label>
|
||||
<Button
|
||||
onClick={() => setShowDeleteAccountConfirm(true)}
|
||||
className={buttonClass({ variant: 'danger', size: 'md' })}
|
||||
>
|
||||
Delete Account
|
||||
</Button>
|
||||
<p className="text-xs text-soft mt-2">
|
||||
Permanently deletes your account and all data.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<div className="pt-2 border-t border-line-soft">
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ export function UserMenu({
|
|||
}
|
||||
|
||||
return (
|
||||
<div className={`flex items-center gap-2 px-2 py-1 rounded-md border border-line bg-surface ${className}`}>
|
||||
<span className="hidden sm:block text-xs font-medium text-foreground truncate max-w-[160px]">
|
||||
<div className={`flex h-7 items-center gap-1.5 rounded-md border border-line bg-surface px-2 ${className}`}>
|
||||
<span className="hidden max-w-[150px] truncate text-[11px] font-medium text-foreground sm:block">
|
||||
{session.user.email || 'Account'}
|
||||
</span>
|
||||
|
||||
|
|
@ -99,6 +99,8 @@ export function UserMenu({
|
|||
onClick={handleDisconnectAccount}
|
||||
title="Disconnect account"
|
||||
aria-label="Disconnect account"
|
||||
size="xs"
|
||||
className="-mr-0.5"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
|
||||
|
|
|
|||
Loading…
Reference in a new issue