@nano-app/backend 0.12.5 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -173,20 +173,21 @@ pnpm add better-auth
|
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
```ts
|
|
176
|
-
// src/auth.ts: the options
|
|
177
|
-
import {
|
|
176
|
+
// src/auth.ts: the options; nano-app creates the instance, the Better Auth CLI reads `options`
|
|
177
|
+
import type { BetterAuthOptions } from 'better-auth';
|
|
178
178
|
|
|
179
|
-
export
|
|
180
|
-
|
|
179
|
+
export default {
|
|
180
|
+
options: { emailAndPassword: { enabled: true } } satisfies BetterAuthOptions,
|
|
181
|
+
};
|
|
181
182
|
```
|
|
182
183
|
|
|
183
184
|
```ts
|
|
184
185
|
// src/app.ts
|
|
185
186
|
import { createNanoApp } from '@nano-app/backend';
|
|
186
|
-
import
|
|
187
|
+
import auth from './auth';
|
|
187
188
|
|
|
188
189
|
createNanoApp({
|
|
189
|
-
packages: { betterAuth:
|
|
190
|
+
packages: { betterAuth: auth.options },
|
|
190
191
|
mainPlugin: { database: { enabled: true } },
|
|
191
192
|
});
|
|
192
193
|
```
|
|
@@ -212,6 +213,7 @@ npx prisma migrate dev
|
|
|
212
213
|
- `createRoute({ public: true, ... })` answers without a session; its handlers still receive `session` when the request has one. An unknown path answers 404.
|
|
213
214
|
- Its own endpoints, the plugins mounted before the app and the middlewares a plugin adds with `app.use` in `onMount` are not checked: a plugin that exposes something public says it in its README.
|
|
214
215
|
- Better Auth is loaded only when it is on.
|
|
216
|
+
- nano-app creates the one instance the app uses: do not call `betterAuth()` in `src/auth.ts`. The CLI's `generate` only reads `options` of its default export.
|
|
215
217
|
|
|
216
218
|
### Permissions
|
|
217
219
|
|