This series is priceless! I've learned so many web dev things in Shawn's channel than anywhere else!
@bensonyeboah2974 жыл бұрын
First....all right then gang!!!!!!!!!!! Love u shawn!
@jovannovakovic59754 жыл бұрын
This is pure gold content. Thank you, Shawn!
@Anonymous-sq6eo3 жыл бұрын
I am really enjoying your videos man, the way you explain the topics make things really clear. Quality content!
@ekaterinanikiforova23424 жыл бұрын
That precious moment when I get another error, and then Shaun gets the same !!!
@gustavodias70032 жыл бұрын
When we validate email and password, it's a good idea not to send separate messages like "incorrect email" and "incorrect password". Send "Incorrect email or password" to preserve user privacy. Because if we enter an existing email in the database with any password, we will easily know that you have an account on xv1d30s, for example haha.
@kamandanuwijaya8910 Жыл бұрын
yes sir agree
@wildarena10884 жыл бұрын
Good work, Shawn! I wish you could do refresh token part also, thanks :)
@sukho-ac3 жыл бұрын
The Explanation is very clear, the content is great, please more often upload a videos thank you so much for the vids 😆🙏
@eminaliyev49534 жыл бұрын
Great stuff, thanks. I am looking forward to end this playlist asap ❤️
@devKazuto4 жыл бұрын
I prefer checking if something is not set or unequal instead of the opposite. Like this: if(!user) { throw Error('incorrect email') } or your code as an example pastebin.com/A6muwDxj This way you don't have your complete code inside an if statement and makes it cleaner and much more legible.
@NetNinja4 жыл бұрын
To be honest I prefer this as well. In this case I just happened to do it the other way.
@kenechukwunwobodo3138 Жыл бұрын
Hello, why do I keep getting User.login is not a function. Please note that I have already created the static method in the model file.
@TechWithDnes4 жыл бұрын
I always want to comment on your video for NO REASON :D
@onoseogbidi383010 ай бұрын
Thank you for another amazing video. I have a question. Is it possible to put the userschema.statics.login code directly inside the login controller instead of putting in the model. I tried it but it didn't work. So just want to know if it is possible?
@TechWithDnes4 жыл бұрын
Instead of creating static method on userSchema, can we do those task in our authController itself? When to use statics?
@codewithbishal8953 жыл бұрын
no
@JS-zm5se3 жыл бұрын
Yes. You can
@pxlloewe14813 жыл бұрын
Thank you for this briliant series! But can you tell me wich syntax code highlighting you are using in VS code? My highlighting looks a bit strange, some variables are just grey, etc.
@SeeKnowledge4 жыл бұрын
How do we know like ( this is async and this sync method ) any idea please help
@TechWithDnes4 жыл бұрын
NOTE: Using arrow function on statics method doesn't work here because of this 😋
@sayansingha84744 жыл бұрын
'this'
@arantebw4 жыл бұрын
Yes, be mindful of arrow function and "this" combination.
@muhrizqiardi3 жыл бұрын
THANK YOU!!! I was wondering why....
@nagame859 Жыл бұрын
Thank you so much!!
@aremukolhade69372 жыл бұрын
Why didn't I get redirect to the home page after signing up/login
@johnmoore42482 жыл бұрын
What is the good thing about adding logic inside mongoose static method rather than inside controller?
@amritgopinath95404 жыл бұрын
Hey net Ninja Can you please make a tutorial on svelte native as I am really interested in svelte and svelte native
@emanmohamed48273 жыл бұрын
I want to ask a question .. by using views which let users signup ,login and see everything in the website , so that means we don't need "front end "technologies like react or something ? i have a problem with the concept of "templates" , i used react before to let user login ,signup , send web tokens pla pla ,but can't get the connection between backend and frontend yet ! btw thanks for this awesome tutorial ..
@ThatGuyAnonymous4 жыл бұрын
Hey Shaun, thanks for this amazing series. I owe most of the things I know to you. Quick question though: is it common for professional dev to just write for themselves large node starters with auth strategies, template routes, email confirmation, file upload... to just use for their new projects? any cons to that? In my current region, I found myself having to write all the code front to back including the design and it's a bit overwhelming. BTW I'm currently following your firebase series (fantastic), but I still love to keep the control nodejs gives for custom projects with complex business logic, any advice?
@damiangowala56814 жыл бұрын
Would you consider your implementation production-ready? Have you used the approach of creating custom authentication in any of your work? Thanks Shawn!
@NetNinja4 жыл бұрын
It really depends on the project. There is more to authentication than I couldn't possibly create in a tutorial series (claims/roles, csrf, password reset etc). I like to teach enough of the theory & demonstrate the core priniciples so people can take it in their own direction afterwards.
@pooriapeyvand24614 жыл бұрын
keep going bro . you are awsome
@NetNinja4 жыл бұрын
Thank you so much 😀
@Anto-mi5pn3 жыл бұрын
Is there a way to send the jwt as a request header instead of a cookie?
@sujalshah8452 Жыл бұрын
thanks for the playlist.
@codeinnode44902 жыл бұрын
Done Great Tutorial :)
@shyamsundargoyal92514 жыл бұрын
trying to understand how he types with his fingers crossed...
@davidk7212 Жыл бұрын
For anybody bothered by the elements moving when error messages are inserted (it drove me crazy), use span tags instead of div tags for the error elements.
@askoldtsentseusti-11222 жыл бұрын
my webstorm doesn't see the login method in the authController, hellp
@satvikjha89324 жыл бұрын
its not working i am getting an error that the fetch didnt got the source,any help?
@remishehzad58144 жыл бұрын
Hi shaun, I really appreciate 🙏 you making these awsome tutorials. Im having problem comparing passwords, it always returns false. Someone on internet said it maybe due the password feild size in the db whicb I cant manage to change. Help me out please
@devkofi4 жыл бұрын
i was having same problem had to do this in the pre save if(user.isModified("password")) { const salt = await bcrypt.genSalt(10); const hash = await bcrypt.hash(user.password, salt); user.password = hash; } hope it works
@remishehzad58144 жыл бұрын
@@devkofi in my case I had to create a pass in lower case because url is case sensitive.
@OsamaAli-dr3mb2 жыл бұрын
I tried to do the static method login but it gives me this error: " Property 'login_post' does not exist on type 'Model'. " . I am using typescript. can you give me any advice? @The Net Ninja
@OsamaAli-dr3mb2 жыл бұрын
I solved the issue by adding the static method inside the schema like this: statics: { async login_post(email, password) { const user = await this.findOne({ email }); if (!user) { throw Error('Incorrect Email') } const auth = await bcrypt.compare(password + process.env.BCRYPT_PASSWORD, user.password); if (!auth) { throw Error('Incorrect Password'); } return user; } }
@TheHangoverer4 жыл бұрын
Shouldn't the client have it's own folder and the server have it's own folder?
@stephaniecrispin674 Жыл бұрын
I don't know who you are personally but I wish I did. You are one of the best gifts God gave to mankind and I'm not exaggerating
@NetNinja Жыл бұрын
Thanks Stephanie! :)
@m12652 Жыл бұрын
Thank you very much 👍
@NetNinja Жыл бұрын
You're very welcome! :)
@ahmedehab54483 жыл бұрын
when i was using this it always gets me null from the database so i changed it to User and it worked instantly !!
@arjobansingh19403 жыл бұрын
Make sure you are using, normal function with keyword function, in statics. Because this keyword points to That model only inside regular function, not inside arrow function. It is a concept in itself, using this keyword in functions. But yeah, make sure you are not using this keyword in arrow function.
@shohagkhan36774 жыл бұрын
Thanks for this very important tutorial. I have one request for you 👏. If you could make a tutorial on graphql react apollo client side, that would be great for us. I think you know that there is not so good tutorial on graphql client side for authentication, authorization, pagination, filtering, file upload. If possible, please keep my request...👏
@cherry-lp8yq4 жыл бұрын
there is no way for deploying a website on internet for free right?
@zeroRedRaptor2314 жыл бұрын
Yes use heroku
@phanisai37224 жыл бұрын
Hello sir, I wish you could do python tutorials.
@satvikjha89324 жыл бұрын
server is responding with 400 for the fetch request
@julianstorm77224 жыл бұрын
It was the static method for me...I typed userSchema.static instead of userSchema.statics as I was following the docs of mongoose...
@askoldtsentseusti-11222 жыл бұрын
also the same problem, how you solved it?
@muhammadmaulanasyahrizal30482 жыл бұрын
@@julianstorm7722 thanks, it workes in my case
@martinp.6174 жыл бұрын
Salamat..,
@D0hG4 жыл бұрын
final year students, anyone ? xD
@ridl274 жыл бұрын
ty.
@note-karlo4 жыл бұрын
🙅♂️🙋♂️
@benabidhoussem47203 жыл бұрын
400 Bad request :( HELP
@encabsss2 жыл бұрын
Remove the curly brace '{}' on User.login under authControllers > Login > inside the try. It should be 'User.login(email, password)' And that should work!
@askoldtsentseusti-11222 жыл бұрын
@@encabsss not working, error in fetch api
@yash_______1052 жыл бұрын
@@askoldtsentseusti-1122 hav u solved it
@askoldtsentseusti-11222 жыл бұрын
@@yash_______105 yes
@askoldtsentseusti-11222 жыл бұрын
@@yash_______105 i forgot to add await to res.json