Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week 7 #24

Open
wants to merge 22 commits into
base: Week_7
Choose a base branch
from
Open

Week 7 #24

wants to merge 22 commits into from

Conversation

aarushic
Copy link

No description provided.



// Verifies password
app.post("/login", async (req, res) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put these login / register functions in the auth.js and put that under routes


// Define route and middlewares
const users = express.Router();
users.use(cors());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep the todo routes in the todo.js file? I think you moved them so you could protect the route via authMiddleware, but you can export the authMiddleware in auth.js and import the auth middleware function here, then apply the middleware to the specified functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants