Next.js Discord

Discord Forum

storing sensitive data in app files

Answered
Satin Angora posted this in #help-forum
Open in Discord
Satin AngoraOP
Hey guys I have question, let's say someone is making a course app, and the courses are just text and not videos.
Are there any security risks involved if you decide to store the courses in markdown files inside the app files and just use the fs module to retrieve them if the user has paid for them? Or is it better and safer to get them from a cms or just any database?
Ps: using pages router if that makes any difference.
Answered by B33fb0n3
they are safe, if you only render them serverside. If you send specific parts to the client, these parts are exposed to the client @Satin Angora
View full answer

6 Replies

they are safe, if you only render them serverside. If you send specific parts to the client, these parts are exposed to the client @Satin Angora
Answer
Satin AngoraOP
I just verify if the user has access to that particular lesson (md file), if they do I send them the file content other wise i just redirect them somewhere (inside getserversideprops)
@Satin Angora fixed?
@B33fb0n3 <@279892635320320000> fixed?
Satin AngoraOP
it wasn't really a problem that gets fixed it was just a security concern, thank you!