peerreynders
Can The load() Function Access Secure Values?
If these sources are anything to go by it's going to be interesting:
https://github.com/orgs/supabase/discussions/1094
https://www.restack.io/docs/supabase-knowledge-supabase-get-user-by-cookie
15 replies
Can The load() Function Access Secure Values?
I'm not sure if "event" is needed in these cases.Those functions are provided by h3 and in SolidStart they take
event.nativeEvent
. It just happens that vinxi wraps them and populates the event for you if you don't provide it.
h3 also provides a session API the one caveat being that always creates a session when you use getSession()
even if there isn't one already; i.e. it assumes that the session always exists, only it's contents is ephemeral.
Example15 replies
Can The load() Function Access Secure Values?
- After successful authentication store JWT in an HttpOnly cookie (i.e. the client JS can't access it).
- Have middleware block requests to protected routes that don't have a cookie header with a valid JWT.
15 replies
Using Router Action with Solid (not SolidStart)
Here is the one I created
https://stackblitz.com/edit/stackblitz-starters-zmfxxa?file=src%2Froutes%2Fabout.tsx
Fork it if you like as I don't know how long I'll keep it.
The basic one I always start with is
https://stackblitz.com/edit/stackblitz-starters-bjbk1s?file=src%2Froutes%2Fabout.tsx
15 replies
Using Router Action with Solid (not SolidStart)
It's an accessor to the value returned by the expression in the
when
prop once the value isn't falsey. Because the Error
is return
ed rather than throw
n it appears on submission.result
rather than submission.error
once submission.pending
transitions from true
to false
.15 replies
How can I make sure that data from createAsync is loaded, before passing it to another function
You're thinking
createResource()
for the last two. createAsync()
doesn't have that signature.
To get a createAsync()
to refetch you revalidate()
the cache
(key) it consumes.
One advantage of the createAsync
/cache
split is that every component can have its own createAsync()
that share the same cache()
wrapper.
With createResource()
everybody shares the same accessor or each component with a createResource
will cause its own async op (e.g. fetch).
The latter is undesirable because
- multiple fetches
- separate components can be at different levels of staleness.10 replies
"[error] UnknownAction" on getSession() in AuthJS
Just an FYI. Same error here:
https://discord.com/channels/722131463138705510/1254011498632708147/1254091696342438029
Doesn't mean your issue is the same.
6 replies
Is there a more proper way to set value across components?
Under most circumstances I would consider this a “code smell”:
i.e. needing access to both the accessor and mutators at the same time.
Compare to:
https://playground.solidjs.com/anonymous/40c07288-1536-4f99-9f6f-283506f87667
6 replies
Is there a more proper way to set value across components?
I would be extremely reluctant to hand out a raw setter like that.
The “owner ” of reactive state should constrain the possible ways in which that state can be modified. The definition of those mutators should be collocated with the state itself and exported (if absolutely necessary) instead of the setter.
https://playground.solidjs.com/anonymous/e26301b5-e5dc-4d69-9304-10022a0b11e1
3. Read/Write segregation.
6 replies