Skip to content

Commit

Permalink
fix(serverauth): Export dbAuthMiddleware as default export to match s…
Browse files Browse the repository at this point in the history
…upabase (#10538)

As title

```js
//before
import { createDbAuthMiddleware } from '@redwoodjs/auth-dbauth-middleware'

// after
import createDbAuthMiddleware from '@redwoodjs/auth-dbauth-middleware'
```
  • Loading branch information
dac09 authored May 7, 2024
1 parent 6107165 commit 254589a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .changesets/10538.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- fix(serverauth): Export dbAuthMiddleware as default export to match supabase (#10538) by @dac09

```js
//before
import { createDbAuthMiddleware } from '@redwoodjs/auth-dbauth-middleware'

// after
import createDbAuthMiddleware from '@redwoodjs/auth-dbauth-middleware'
```
4 changes: 2 additions & 2 deletions packages/auth-providers/dbAuth/middleware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { TagDescriptor } from '@redwoodjs/web'

import App from './App'
import { createDbAuthMiddleware } from '@redwoodjs/auth-dbauth-middleware'
import createDbAuthMiddleware from '@redwoodjs/auth-dbauth-middleware'
import { Document } from './Document'

// eslint-disable-next-line no-restricted-imports
Expand All @@ -22,7 +22,7 @@ export const registerMiddleware = () => {
cookieName,
dbAuthHandler,
getCurrentUser,
// dbAuthUrl? optional
// dbAuthUrl? optional
})
return [dbAuthMiddleware]
}
Expand Down
2 changes: 2 additions & 0 deletions packages/auth-providers/dbAuth/middleware/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ export const createDbAuthMiddleware = ({
return res
}
}

export default createDbAuthMiddleware

0 comments on commit 254589a

Please sign in to comment.