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

Where is verifyUser invoked? #4

Closed
corderophi678 opened this issue Apr 13, 2018 · 2 comments
Closed

Where is verifyUser invoked? #4

corderophi678 opened this issue Apr 13, 2018 · 2 comments

Comments

@corderophi678
Copy link

In /src/api/modules/auth.js the signin function has a comment that says "req.user will be there from the middleware verify user." But it's unclear to me where verifyUser is invoked in order to put the user's id on the req object. Any help would be super appreciated.

@timiscoding
Copy link

timiscoding commented May 5, 2018

I use it like so app.use('/signin', verifyUser(), signin) in place of this line

app.use('/signin', signin)

Auth is actually quite broken but luckily the instructor doesn't use it, he just bypasses it by creating a new user or disabling auth altogether.

Check out my branch if you want to see how I got auth to work. I had to replace bcrypt with bcryptjs npm package as it was complaining it couldn't find bcrypt_lib.node whenever I tried to import it. This seems to be caused by bcrypt not being able to download a precompiled bcrypt lib and the fallback failing to build from source.

@Hendrixer
Copy link
Collaborator

thanks @timiscoding . You'll have to use it as middleware in your route for auth like @timiscoding said @corderophi678 .

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

No branches or pull requests

3 participants