NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Senior2 views

How would you handle user authorization when they sign in to the interface and upload documents?

Practice

Asked at

AI answer

When a user signs in, the backend verifies their credentials or delegates authentication to an identity provider via OIDC/OAuth2. After successful authentication, the user receives a secure session or token; with every request, the server checks not only the user’s identity but also their permission to access the requested resource. To upload a document, the backend first checks the user’s permissions and creates a record with metadata and a status, then issues a short-lived signed URL for uploading to private Object Storage. After upload, the file is checked for size and permitted format, scanned for viruses, and its status is updated. Do not rely solely on checks in the browser or on the file name; with cookie-based sessions, CSRF protection must also be considered.