storing sensitive data in app files
Answered
Satin Angora posted this in #help-forum
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.
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
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 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)
yea, you can use this markdown page from next:
https://nextjs.org/docs/app/building-your-application/configuring/mdx
And this middleware page from next:
https://nextjs.org/docs/app/building-your-application/routing/middleware
https://nextjs.org/docs/app/building-your-application/configuring/mdx
And this middleware page from next:
https://nextjs.org/docs/app/building-your-application/routing/middleware
@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!