Server actions help
Answered
In&Out posted this in #help-forum
In&OutOP
Hey folks, i have a client component and actions.ts, and if i use a function from actions.ts, thats a server action funcion into the client component, is that insecure, is the function running on client or is everything fine?
17 Replies
In&OutOP
"use client";
import { useEffect, useState } from "react";
import { createPage, fetchPages, updatePageTitle } from "@/components/actions";
server actions are just syntactic sugar on top of normal http post requests
it should follow the same principles as normal http requests
validate the body before using
@Yi Lon Ma validate the body before using
In&OutOP
so its not running on server or what?
i dont get you sorry
it runs on the server
In&OutOP
so it should be secure?
secure in which context
In&OutOP
idk lol, the standards i guess
secure as in querying db, calling other APIs or secure as in "the payload is validated"
In&OutOP
querying db and calling api
yea its secure in that context
Answer
In&OutOP
"the payload is validated", this is on me yeah?
That part i gotta do myself yeah?
yea
In&OutOP
okay thank you