@alstar/studio 0.0.0-beta.13 → 0.0.0-beta.14

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.
Files changed (2) hide show
  1. package/api/auth.ts +11 -14
  2. package/package.json +3 -3
package/api/auth.ts CHANGED
@@ -9,24 +9,21 @@ import { setCookie } from 'hono/cookie'
9
9
  const app = new Hono<{ Bindings: HttpBindings }>()
10
10
 
11
11
  app.post('/register', async (c) => {
12
- return streamSSE(c, async (stream) => {
13
- const formData = await c.req.formData()
14
- const data = Object.fromEntries(formData.entries())
15
-
16
- if (!data || !data.email || !data.password) return
12
+ const formData = await c.req.formData()
13
+ const data = Object.fromEntries(formData.entries())
17
14
 
18
- const hash = createHash(data.password.toString())
15
+ if (!data || !data.email || !data.password) return
19
16
 
20
- db.insertInto('users', {
21
- email: data.email?.toString(),
22
- hash: hash,
23
- })
17
+ const hash = createHash(data.password.toString())
24
18
 
25
- await stream.writeSSE({
26
- event: 'datastar-patch-signals',
27
- data: `signals { status: 200, message: 'User "${data.email}" created successfully' }`,
28
- })
19
+ db.insertInto('users', {
20
+ email: data.email?.toString(),
21
+ hash: hash,
29
22
  })
23
+
24
+ setCookie(c, 'login', 'yes')
25
+
26
+ return c.redirect('/studio')
30
27
  })
31
28
 
32
29
  app.post('/login', async (c) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alstar/studio",
3
- "version": "0.0.0-beta.13",
3
+ "version": "0.0.0-beta.14",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "engines": {
@@ -11,8 +11,8 @@
11
11
  "@starfederation/datastar-sdk": "1.0.0-RC.1",
12
12
  "hono": "^4.8.12",
13
13
  "@alstar/refresher": "0.0.0-beta.3",
14
- "@alstar/ui": "0.0.0-beta.1",
15
- "@alstar/db": "0.0.0-beta.1"
14
+ "@alstar/db": "0.0.0-beta.1",
15
+ "@alstar/ui": "0.0.0-beta.1"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^24.1.0",