@ley0x/better-auth-lastfm 1.2.0 → 1.2.1
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 +48 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -44,7 +44,12 @@ export const auth = betterAuth({
|
|
|
44
44
|
// Optional: set base URL (usually auto-detected)
|
|
45
45
|
baseUrl: process.env.BETTER_AUTH_URL
|
|
46
46
|
})
|
|
47
|
-
]
|
|
47
|
+
],
|
|
48
|
+
// Optional: customize session expiration (default: 7 days)
|
|
49
|
+
session: {
|
|
50
|
+
expiresIn: 60 * 60 * 24 * 30, // 30 days
|
|
51
|
+
updateAge: 60 * 60 * 24 // Update session every day
|
|
52
|
+
}
|
|
48
53
|
})
|
|
49
54
|
```
|
|
50
55
|
|
|
@@ -147,6 +152,48 @@ BETTER_AUTH_SECRET=your_secret_here # BetterAuth secret
|
|
|
147
152
|
|
|
148
153
|
The plugin uses BetterAuth's standard user and account tables. Last.fm session keys are stored in the `accessToken` field of the account record.
|
|
149
154
|
|
|
155
|
+
## Session Configuration
|
|
156
|
+
|
|
157
|
+
By default, BetterAuth sessions expire after 7 days. You can customize the session expiration by adding a `session` configuration object to your `betterAuth` configuration:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
export const auth = betterAuth({
|
|
161
|
+
plugins: [lastfmPlugin({ /* ... */ })],
|
|
162
|
+
session: {
|
|
163
|
+
expiresIn: 60 * 60 * 24 * 30, // 30 days (default: 7 days)
|
|
164
|
+
updateAge: 60 * 60 * 24 // Update session every day (default: 1 day)
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Important: Session Persistence Fix
|
|
170
|
+
|
|
171
|
+
**Note**: A recent fix ensures sessions persist across browser restarts. The plugin now properly respects cookie `maxAge` settings. See [SESSION_PERSISTENCE_SOLUTION.md](SESSION_PERSISTENCE_SOLUTION.md) for details.
|
|
172
|
+
|
|
173
|
+
### Recommended Configuration for Persistence
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
export const auth = betterAuth({
|
|
177
|
+
plugins: [lastfmPlugin({ /* ... */ })],
|
|
178
|
+
session: {
|
|
179
|
+
expiresIn: 60 * 60 * 24 * 30, // 30 days
|
|
180
|
+
updateAge: 60 * 60 * 24,
|
|
181
|
+
cookieCache: {
|
|
182
|
+
enabled: true,
|
|
183
|
+
maxAge: 60 * 60 * 24,
|
|
184
|
+
strategy: 'compact'
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
cookies: {
|
|
188
|
+
sessionToken: {
|
|
189
|
+
attributes: {
|
|
190
|
+
maxAge: 60 * 60 * 24 * 30 // Persistent cookie
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
```
|
|
196
|
+
|
|
150
197
|
## API Reference
|
|
151
198
|
|
|
152
199
|
### `lastfmPlugin(options)`
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ley0x/better-auth-lastfm",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Last.fm authentication plugin for BetterAuth",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"zod": "^4.3.6"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@eslint/js": "^
|
|
51
|
-
"@types/node": "^25.0
|
|
50
|
+
"@eslint/js": "^10.0.1",
|
|
51
|
+
"@types/node": "^25.5.0",
|
|
52
52
|
"better-auth": "latest",
|
|
53
|
-
"eslint": "^
|
|
53
|
+
"eslint": "^10.1.0",
|
|
54
54
|
"tsup": "^8.5.1",
|
|
55
55
|
"typescript": "^5.9.3",
|
|
56
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"typescript-eslint": "^8.57.2",
|
|
57
57
|
"vitest": "^1.6.1"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|