Using use:enhance in form to get data from action function #10746
-
Hi, this is my first post in this repository, and trying to self-learn programming. Recently I posted a problem on Reddit and someone there told me, to use the load function always for any data serving from the server after form submission, which is understandable for authentication or other sensitive data. Is this also applicable to less sensitive data like populating table data from the server?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is fine let { data, error } = await supabase.rpc('fake_op', {
name_input: name,
}); This code, inside the action, will only run server side so there is no leaking of any api keys or other things. |
Beta Was this translation helpful? Give feedback.
This is fine
This code, inside the action, will only run server side so there is no leaking of any api keys or other things.
However, if supabase is returning data that you do not want to expose completely to the client you should probably do some sanitizing step here (but in that case you should do it in your
load
as well.