@stacksjs/defaults 0.74.59 → 0.74.60

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,5 +1,5 @@
1
1
  import { Action } from '@stacksjs/actions'
2
- import { Auth, clearAuthCookie, requestToken } from '@stacksjs/auth'
2
+ import { Auth, browserSessionLogoutRedirect, clearAuthCookie, requestToken } from '@stacksjs/auth'
3
3
  import { getCurrentRequest, response } from '@stacksjs/router'
4
4
 
5
5
  export default new Action({
@@ -9,16 +9,17 @@ export default new Action({
9
9
  async handle() {
10
10
  const request = getCurrentRequest()
11
11
  const usesDatabaseSession = !requestToken(request) && !!request?.cookie?.('session_id')
12
+ const redirect = browserSessionLogoutRedirect(request)
12
13
  await Auth.logout()
13
14
 
14
15
  // Clearing is separate from revoking, and both are needed. Revoking alone
15
16
  // leaves the browser sending a dead cookie on every request; clearing alone
16
17
  // leaves a copied cookie valid for the token's whole lifetime, which would
17
18
  // make "log out on a shared computer" mean only "hide the key".
18
- const result = response.json(
19
- { message: 'Successfully logged out' },
20
- { headers: { 'Set-Cookie': clearAuthCookie() } },
21
- )
19
+ const result = redirect
20
+ ? response.redirect(redirect, 303)
21
+ : response.json({ message: 'Successfully logged out' })
22
+ result.headers.append('Set-Cookie', clearAuthCookie())
22
23
  if (usesDatabaseSession)
23
24
  result.headers.append('Set-Cookie', clearAuthCookie({ name: 'session_id' }))
24
25
  return result
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.74.59",
5
+ "version": "0.74.60",
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.59",
5
+ "version": "0.74.60",
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.59",
58
+ "@stacksjs/mobile": "^0.74.60",
59
59
  "@stacksjs/sanitizer": "^0.2.113",
60
60
  "ts-qr-codes": "^0.1.8"
61
61
  }