Skip to content

New sessions driver config API #14967

@florian-lefebvre

Description

@florian-lefebvre

Currently the sessions driver config is really tied to unstorage. The goal of this task is to introduce a new way to provide drivers, not unstorage specific:

-import { defineConfig } from 'astro/config'
+import { defineConfig, sessionDrivers } from 'astro/config'

export default defineConfig({
  session: {
-    driver: 'redis',
-    options: {
-      url: process.env.REDIS_URL
-    },
+    driver: sessionDrivers.redis({
+      url: process.env.REDIS_URL
+    }),
  }
})

This would remain backward compatible in v6 by simply deprecating options and driver as strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions