fix(auth): unmount the module's build-time oidc mount before Redis mount
ci / typecheck (map[dir:apps/booking name:booking]) (push) Successful in 20s
ci / typecheck (map[dir:apps/operator name:operator]) (push) Successful in 22s
ci / typecheck (map[dir:apps/portal name:portal]) (push) Successful in 21s
ci / typecheck (map[dir:apps/website name:website]) (push) Successful in 22s
ci / typecheck (map[dir:services/platform-api name:platform-api]) (push) Successful in 21s
ci / test (push) Successful in 31s
ci / build (map[dir:apps/booking name:booking]) (push) Successful in 9s
ci / build (map[dir:apps/operator name:operator]) (push) Successful in 30s
ci / build (map[dir:services/platform-api name:platform-api]) (push) Successful in 5s
ci / build (map[dir:apps/portal name:portal]) (push) Successful in 38s
ci / deploy (push) Successful in 42s
ci / typecheck (map[dir:apps/booking name:booking]) (push) Successful in 20s
ci / typecheck (map[dir:apps/operator name:operator]) (push) Successful in 22s
ci / typecheck (map[dir:apps/portal name:portal]) (push) Successful in 21s
ci / typecheck (map[dir:apps/website name:website]) (push) Successful in 22s
ci / typecheck (map[dir:services/platform-api name:platform-api]) (push) Successful in 21s
ci / test (push) Successful in 31s
ci / build (map[dir:apps/booking name:booking]) (push) Successful in 9s
ci / build (map[dir:apps/operator name:operator]) (push) Successful in 30s
ci / build (map[dir:services/platform-api name:platform-api]) (push) Successful in 5s
ci / build (map[dir:apps/portal name:portal]) (push) Successful in 38s
ci / deploy (push) Successful in 42s
nuxt-oidc-auth registers its own 'oidc' storage mount at build, so
storage.mount('oidc', …) at runtime threw 'already mounted at oidc:' and
crash-looped the new pods. Unmount the memory mount first.
This commit is contained in:
@@ -10,10 +10,14 @@
|
||||
// operator-secrets). Unset in dev → in-memory mount stays, no Redis needed.
|
||||
import redisDriver from 'unstorage/drivers/redis'
|
||||
|
||||
export default defineNitroPlugin(() => {
|
||||
export default defineNitroPlugin(async () => {
|
||||
const url = process.env.SESSION_REDIS_URL
|
||||
if (!url) return
|
||||
useStorage().mount(
|
||||
const storage = useStorage()
|
||||
// The module ships its own build-time 'oidc' mount (memory driver) — it
|
||||
// must be unmounted first or mount() throws 'already mounted at oidc:'.
|
||||
await storage.unmount('oidc')
|
||||
storage.mount(
|
||||
'oidc',
|
||||
redisDriver({
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user