---
url: /saas-starter/v0.10.1/releases/v0.6.0.md
---
# v0.6.0

File storage for every app, file attachments on Todos, profile pictures and organisation logos,
an optional Aspire AppHost,
and staying signed in across reloads and tabs, with the refresh token in an HttpOnly cookie.

## Changes to know about

* **New packages in every app:** `AWSSDK.S3` (Apache-2.0) and `Azure.Storage.Blobs` (MIT), for
  the S3 and Azure storage providers. Local disk stays the default and needs neither service.
* **`deploy/docker-compose.yml` keeps uploaded files** in an `app-files` volume, with a one-shot
  `app-files-owner` service that hands the volume to the app's non-root user. Back the volume up
  with the database (`deploy/README.md`).
* **The Content-Security-Policy is built from `ContentSources`** (`Security/SecurityHeaders.cs`),
  which adds the storage provider's address and, with accounts, Gravatar's. Code that called
  `SecurityHeaders.ContentSecurityPolicyAllowing` now calls `ContentSecurityPolicy(sources, hashes)`.
* **New fields in responses** (with accounts): `pictureUrl` on `/api/auth/me`, organisation members
  and admin users; `logoUrl` on organisations (`saas`); `gravatar` on `/api/auth/options`.
* **EF Core:** new migrations add a `TodoAttachments` table (every app), `AspNetUsers.PictureKey`
  (accounts) and `Organisations.LogoKey` (`saas`).
* **Todos have `attachments`** in `GET /api/todos` (Marten keeps them in the Todo's events and
  snapshot).
* **Signed downloads are always attachments:** `IFileStorage.CreateDownloadUrlAsync` takes the
  name to save the file as, and every provider sends `Content-Disposition: attachment` (signed
  into S3 and Azure URLs), so an uploaded HTML or SVG file never opens as a page.
* **`.gitignore` ignores only `src/ApiHost/data/files/`** (uploads while developing), not
  `src/ApiHost/data/`: where git ignores case (macOS, Windows), that also matched `Data/` and left
  new EF Core migrations out of commits.
* **`deploy/docker-compose.yml`'s `app-files-owner`** only hands the volume over when it isn't the
  app's yet, instead of going through every file on each start.
* **Picture, logo and attachment uploads are rate limited** per user (`Pictures__UploadsPerMinute`,
  10 a minute by default).
* **Deleting an account or organisation deletes its files through a `DeleteStoredFiles` message**
  of its own, so a storage outage can't stop the rest of the deletion. Features that keep files
  should do the same (`docs/file-storage.md#deleting-an-owners-files`).
* **Token responses' `refreshToken` is null for browsers** (with accounts): a request with the
  `X-Refresh-Token-Cookie: true` header gets it in a cookie instead. `refreshToken` in the bodies
  of `/api/auth/refresh`, `/api/auth/logout` and `/api/organisations/switch` is now optional
  (the cookie is used without it), and `/api/auth/refresh` takes an optional `organisationId`
  (`saas`). Clients without the header, such as mobile apps, see no change.
* **`vite.config.ts`** reads the API's address from Aspire's `services__api__http__0` when it's
  set, and otherwise uses `http://localhost:5133` as before.

Projects created from earlier versions don't change: a template update only affects new projects.

## New

* **File storage** (every app): one `IFileStorage` interface with local disk (the default), any
  S3-compatible store (AWS S3, Cloudflare R2, Backblaze B2, Wasabi, Hetzner, Google Cloud Storage,
  self-hosted SeaweedFS, Garage, Ceph or RustFS) and Azure Blob Storage, chosen with
  `Storage__Provider`. Browsers upload and download with short-lived signed URLs; local downloads
  are sandboxed so an uploaded page or SVG can't run as the app. One test suite runs against all
  three providers, and `docker compose --profile storage up -d` starts SeaweedFS and Azurite to try
  them. See the generated app's `docs/file-storage.md`.
* **File attachments on Todos** (every app), the worked example of large uploads: the browser
  uploads straight to storage with a signed URL, then the API checks the file and attaches it.
  Encrypted upload tokens, size and count limits (`Attachments__MaxBytes`, 25 MB;
  `Attachments__MaxPerTodo`, 10), abandoned uploads deleted, downloads saved under the file's name.
* **Profile pictures** (accounts): upload one in Settings, cropped and resized in the browser and
  checked by the server without an image library, and served at `/media/...` so a CDN can cache
  it. Without one, their initials are shown, or their Gravatar if you set
  `Pictures__Gravatar=true` (off by default: it shares a hash of their email with Gravatar). Shown in the header, member
  lists and the admin page.
* **Organisation logos** (`saas`): owners and admins set one on the organisation page; the switcher
  shows it.
* **`--Aspire true`**: an Aspire AppHost that starts PostgreSQL, Mailpit, the API and the Vite dev
  server with one command, with the Aspire dashboard. Development only; Docker Compose stays the
  default, and production doesn't change. See the generated app's `docs/how-to/run-with-aspire.md`.
* **Stay signed in across reloads and tabs** (accounts): the browser's refresh token moves to an
  HttpOnly, `SameSite=Strict` cookie that page scripts can't read. Reloading, new tabs and
  duplicated tabs stay signed in; tabs take turns to refresh (Web Locks) and sign in and out
  together (`BroadcastChannel`); each tab keeps its own organisation (`saas`). Before, a reload
  signed you out.
* **Mobile and desktop apps** use the same API: without the `X-Refresh-Token-Cookie` header, the
  refresh token still comes back in the response body. New guide:
  `docs/how-to/sign-in-from-a-mobile-app.md`.
* **A grace period for refresh token reuse:** a replaced refresh token is accepted for 30 seconds
  (`Jwt:RefreshTokenReuseGraceSeconds`), so tabs refreshing at once and apps retrying a lost
  response aren't taken for theft.
