Open bogeychan opened 2 months ago
1.1.13
WSL Ubuntu
import { Elysia, t } from "elysia"; new Elysia({ aot: false, cookie: { // both constructor secret and cookie schema (see below) doesn't work secrets: "Fischl von Luftschloss Narfidort", sign: ["profile"], }, }) .get( "/", ({ cookie: { profile } }) => { profile.value = { id: 617, name: "Summoning 101", }; }, { cookie: t.Cookie( { profile: t.Optional( t.Object({ id: t.Numeric(), name: t.String(), }) ), } // { // secrets: "Fischl von Luftschloss Narfidort", // sign: ["profile"], // } ), } ) .listen(8080);
GET http://localhost:8080/
signed cookie
%7B%22id%22%3A617%2C%22name%22%3A%22Summoning%20101%22%7D -> '{"id":617,"name":"Summoning 101"}'
I assume this doesn't work with aot: true and false, its kinda blocked by https://github.com/elysiajs/elysia/issues/832
aot: true
false
reported on discord
node_modules
bun.lockb
yes
I found that the cookie schema does not inherit global settings. When I remove the cookie schema, the global settings work properly. Is this the expected behavior?
What version of Elysia is running?
1.1.13
What platform is your computer?
WSL Ubuntu
What steps can reproduce the bug?
GET http://localhost:8080/
What is the expected behavior?
signed cookie
What do you see instead?
%7B%22id%22%3A617%2C%22name%22%3A%22Summoning%20101%22%7D -> '{"id":617,"name":"Summoning 101"}'
Additional information
I assume this doesn't work with
aot: true
andfalse
, its kinda blocked by https://github.com/elysiajs/elysia/issues/832reported on discord
Have you try removing the
node_modules
andbun.lockb
and try again yet?yes