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 { isValidDocumentId } from '@/lib/server/documents/blobstore';
|
||||||
import { normalizeParseStatus, parseDocumentParseState } from '@/lib/server/documents/parse-state';
|
import { normalizeParseStatus, parseDocumentParseState } from '@/lib/server/documents/parse-state';
|
||||||
import { healStaleDocumentParseState } from '@/lib/server/documents/parse-state-healing';
|
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 { isS3Configured } from '@/lib/server/storage/s3';
|
||||||
import { createRequestLogger, hashForLog } from '@/lib/server/logger';
|
import { createRequestLogger, hashForLog } from '@/lib/server/logger';
|
||||||
import { errorResponse } from '@/lib/server/errors/next-response';
|
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()
|
? requestedOpIdRaw.trim()
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const testNamespace = getOpenReaderTestNamespace(req.headers);
|
|
||||||
const storageUserId = authCtxOrRes.userId;
|
const storageUserId = authCtxOrRes.userId;
|
||||||
const storageUserIdHash = hashForLog(storageUserId);
|
const storageUserIdHash = hashForLog(storageUserId);
|
||||||
const allowedUserIds = [storageUserId];
|
const allowedUserIds = [storageUserId];
|
||||||
|
|
|
||||||
|
|
@ -1252,18 +1252,20 @@ export function SettingsModal({
|
||||||
Disconnect account
|
Disconnect account
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<div className="pt-4 mt-4 border-t border-line-soft">
|
{enableDestructiveDelete && (
|
||||||
<label className="block text-sm font-medium text-danger mb-2">Danger Zone</label>
|
<div className="pt-4 mt-4 border-t border-line-soft">
|
||||||
<Button
|
<label className="block text-sm font-medium text-danger mb-2">Danger Zone</label>
|
||||||
onClick={() => setShowDeleteAccountConfirm(true)}
|
<Button
|
||||||
className={buttonClass({ variant: 'danger', size: 'md' })}
|
onClick={() => setShowDeleteAccountConfirm(true)}
|
||||||
>
|
className={buttonClass({ variant: 'danger', size: 'md' })}
|
||||||
Delete Account
|
>
|
||||||
</Button>
|
Delete Account
|
||||||
<p className="text-xs text-soft mt-2">
|
</Button>
|
||||||
Permanently deletes your account and all data.
|
<p className="text-xs text-soft mt-2">
|
||||||
</p>
|
Permanently deletes your account and all data.
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="pt-2 border-t border-line-soft">
|
<div className="pt-2 border-t border-line-soft">
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ export function UserMenu({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-center gap-2 px-2 py-1 rounded-md border border-line bg-surface ${className}`}>
|
<div className={`flex h-7 items-center gap-1.5 rounded-md border border-line bg-surface px-2 ${className}`}>
|
||||||
<span className="hidden sm:block text-xs font-medium text-foreground truncate max-w-[160px]">
|
<span className="hidden max-w-[150px] truncate text-[11px] font-medium text-foreground sm:block">
|
||||||
{session.user.email || 'Account'}
|
{session.user.email || 'Account'}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
@ -99,6 +99,8 @@ export function UserMenu({
|
||||||
onClick={handleDisconnectAccount}
|
onClick={handleDisconnectAccount}
|
||||||
title="Disconnect account"
|
title="Disconnect account"
|
||||||
aria-label="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">
|
<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>
|
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue