salihozdemir / stackoverflow-clone Goto Github PK
View Code? Open in Web Editor NEWThis project is a simplified a full stack clone of Stackoverflow.
Home Page: https://clone-of-stackoverflow.vercel.app
License: MIT License
This project is a simplified a full stack clone of Stackoverflow.
Home Page: https://clone-of-stackoverflow.vercel.app
License: MIT License
When you decode the provided JWT token to authorize the request, you're not checking whether the JWT token is genuine; that it was signed by you, and the contents are valid.
stackoverflow-clone/server/middlewares/requireAuth.js
Lines 8 to 17 in eb722ec
This means that I could create my own token, pretending to be any user I like, and your server won't check to see if it's a forgery.
I could also create a token that contains { role: "admin" }
and do whatever an admin can do:
This is also a problem in your reddit-clone repo
For example, this completely fake & unsigned JWT token I made myself:
e30.eyJpZCI6MSwidXNlcm5hbWUiOiJhbGljZSIsInJvbGUiOiJhZG1pbiJ9
Which contains this fake data:
{
id: 1,
username: "alice",
role: "admin"
}
Would allow me to bypass your requireAuth
middleware.
The library you're using to do this (jwt-decode
) has a large warning about this on its README:
jwt-decode is a small browser library that helps decoding JWTs token which are Base64Url encoded.
IMPORTANT: This library doesn't validate the token, any well formed JWT can be decoded. You should validate the token in your server-side logic by using something like express-jwt, koa-jwt, Owin Bearer JWT, etc.
NVM figured it out
Hello,
First of all, "ellerine sağlık", the project is great!
I think changing the name into something else (maybe another error like segmentation fault to keep the joke) would be better, because this project may be easily turned into a self-hosted version of Stack Overflow (actually a self-hosted Q&A platform) and may be used by organizations or projects that need such solution.
Best regards,
I create the cluster, the user and then allowing all IPs to have access to my cluster. I press connect to get the application string and change the with my password leaving the default database myFirst Database. When I paste the string to the DATABASE_URL variable and then press deploy I get {"message":"Not found"}. What am I doing wrong?
HI Team,
Anyone working on searching. Maybe if searching is included it will be complete pack!!.
Thanks
add DATABASE_URL and JWT_SECRET in .env file?
First Congratulations for your work, I'm trying to get better at front end and react. I'm trying to understand how is the process do you take when you clone?
Seems server side not started successfully
Unhandled Runtime Error
Error: Network Error
Call Stack
createError
node_modules/axios/lib/core/createError.js (16:0)
XMLHttpRequest.handleError
node_modules/axios/lib/adapters/xhr.js (83:0)
a-nai@a-nai:~/stackoverflow-clone/server$ sudo npm run start
[email protected] start /home/a-nai/stackoverflow-clone/server
node index.js
at http://84.201.145.163:8080 i get
{"message":"Not found"}
I try to test stackoverflow-clone on local with Linux, but I have this alert in the page, instead of the database content.
Unhandled Runtime Error
Error: Request failed with status code 500
Call Stack
createError
node_modules/axios/lib/core/createError.js (16:0)
settle
node_modules/axios/lib/core/settle.js (17:0)
handleLoad
node_modules/axios/lib/adapters/xhr.js (61:0)
Is there an admin panel?
While answering the question. Please add a note if the user is new, saying " UserName123 is a new contributor. Be nice, and check out our Code of Conduct."
Hi, can you please mention the source where you found this data of users, questions, tags etc
So far this clone looks beautiful. Best way to get a lot of tips/fixes/etc. would be to include a vercel "deploy" link or deploy instructions for vercel.
I am unable to get the application to use a basePath parameter supplied in the next.config.js file:
adding
module.exports = { basePath: '/somepath' ...
doesn't seem to have any effect
DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version
Hey there! I am new to programming and I know only firebase... Could you create the same clone ( all the files should be same) but only replace mongodb with firebase?
you must limit options to unknown people
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.