@stacksjs/defaults 0.74.61 → 0.74.62

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-dashboard
3
- description: Use when building or customizing the Stacks admin dashboard, including dashboard pages, model management views, analytics widgets, commerce dashboards, content management, settings panels, deployment monitoring, job/queue management, or the 400 built-in dashboard components. Covers the dashboard system at storage/framework/defaults/.
3
+ description: Use when building or customizing the Stacks admin dashboard, including dashboard pages, model management views, analytics widgets, commerce dashboards, content management, settings panels, deployment monitoring, job/queue management, or the 401 built-in dashboard components. Covers the dashboard system at storage/framework/defaults/.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -8,7 +8,7 @@ allowed-tools: Read Edit Write Bash Grep Glob
8
8
 
9
9
  # Stacks Dashboard
10
10
 
11
- The Stacks admin dashboard provides a full-featured admin panel with 100+ route views, 400 components, and a multi-section layout.
11
+ The Stacks admin dashboard provides a full-featured admin panel with 100+ route views, 401 components, and a multi-section layout.
12
12
 
13
13
  ## Key Paths
14
14
  - Dashboard components: `storage/framework/defaults/resources/components/Dashboard/`
@@ -1,5 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
- import { Auth, authCookie, withMagicLink } from '@stacksjs/auth'
2
+ import { Auth, authCookieForBrowserSession, resolveBrowserSessionPolicy, withMagicLink } from '@stacksjs/auth'
3
3
  import { config } from '@stacksjs/config'
4
4
  import { response } from '@stacksjs/router'
5
5
  import { schema } from '@stacksjs/validation'
@@ -20,9 +20,13 @@ export default new Action({
20
20
  if (!config.auth.magicLink?.enabled)
21
21
  return response.notFound('Magic-link sign-in is not enabled')
22
22
 
23
+ const policy = resolveBrowserSessionPolicy(false)
23
24
  const consumed = await withMagicLink(String(request.get('token')), async grant => ({
24
25
  grant,
25
- result: await Auth.loginUsingId(grant.userId),
26
+ result: await Auth.loginUsingId(grant.userId, {
27
+ expiresInMinutes: policy.expiresInMinutes,
28
+ withRefreshToken: policy.withRefreshToken,
29
+ }),
26
30
  }))
27
31
  if (!consumed.ok) {
28
32
  const messages: Record<string, string> = {
@@ -51,6 +55,6 @@ export default new Action({
51
55
  email: result.user?.email,
52
56
  name: result.user?.name,
53
57
  },
54
- }, { headers: { 'Set-Cookie': authCookie(result.token) } })
58
+ }, { headers: { 'Set-Cookie': authCookieForBrowserSession(result.token, result.expiresIn) } })
55
59
  },
56
60
  })
@@ -1,5 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
- import { Auth, authCookie, resolveSocialSignIn, SocialSignInRefusedError } from '@stacksjs/auth'
2
+ import { Auth, authCookieForBrowserSession, resolveBrowserSessionPolicy, resolveSocialSignIn, SocialSignInRefusedError } from '@stacksjs/auth'
3
3
  import { log } from '@stacksjs/logging'
4
4
  import { response } from '@stacksjs/router'
5
5
  import { isSocialProviderConfigured, socialHandoffFailureRedirect, socialHandoffRedirect, socialProvider } from '@stacksjs/socials'
@@ -45,7 +45,11 @@ export default new Action({
45
45
 
46
46
  const { userId } = await resolveSocialSignIn(provider, identity)
47
47
 
48
- const session = await Auth.loginUsingId(userId)
48
+ const policy = resolveBrowserSessionPolicy(false)
49
+ const session = await Auth.loginUsingId(userId, {
50
+ expiresInMinutes: policy.expiresInMinutes,
51
+ withRefreshToken: policy.withRefreshToken,
52
+ })
49
53
  if (!session?.token)
50
54
  return socialHandoffFailureRedirect('Sign-in could not be completed. Please try again.')
51
55
 
@@ -61,7 +65,7 @@ export default new Action({
61
65
  })
62
66
 
63
67
  // The cookie signs server-rendered pages in; the fragment pack the SPA.
64
- redirect.headers.append('Set-Cookie', authCookie(session.token))
68
+ redirect.headers.append('Set-Cookie', authCookieForBrowserSession(session.token, session.expiresIn))
65
69
  return redirect
66
70
  }
67
71
  catch (error) {
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.74.61",
5
+ "version": "0.74.62",
6
6
  "description": "A modern Stacks development environment.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.74.61",
5
+ "version": "0.74.62",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@iconify-json/f7": "^1.2.2",
57
57
  "@iconify-json/hugeicons": "^1.2.27",
58
- "@stacksjs/mobile": "^0.74.61",
58
+ "@stacksjs/mobile": "^0.74.62",
59
59
  "@stacksjs/sanitizer": "^0.2.113",
60
60
  "ts-qr-codes": "^0.1.8"
61
61
  }