0:00 Intro 0:52 Create repo & initialize Git 4:09 Create main.go 5:11 Gin Framework 7:04 Create endpoint for /api/register 9:08 Define User struct in the DTO 11:46 Create the errors package 15:02 Create user service 17:52 Encrypt password using bcrypt 19:39 Create Data Access Object (DAO) 20:27 Configure mysql database 23:04 MySQL workbench 27:24 Write query to insert user in the DAO 33:34 Define endpoints for /api/login, /api/get, & api/logout 34:23 Create the controller, service, & dao for /api/login 43:27 Generate JWT token using the jwt-go package 48:00 Create the controller, service, & dao for /api/user 49:03 Parse JWT Token 57:43 Remove cookie for /api/logout 59:14 Resolving CORS policy error using gin-contrib/cors package 1:01:15 Run main.go & dry run using Postman
@jakubklimek50123 жыл бұрын
The best video about jwt in gin so far
@pss_crs2 жыл бұрын
I'm not sure you have that in mind but you also have a good description of architecture and workflow
@dhij2 жыл бұрын
Appreciate that!
@Juswahh2 жыл бұрын
Exactly what I wanted to learm today.. thank you youre awesome my friend
@dhij2 жыл бұрын
Glad it helped!
@sustainedcruelty2 жыл бұрын
Thanks so much for making this. It was super useful and easy to understand!
@dhij2 жыл бұрын
thats awesome! appreciate that!
@min-of8cv3 жыл бұрын
Nice & clear explanation, keep up the good work. Hopefully there would be a part 2.
@dhij3 жыл бұрын
Thank you! Yup, I will have part 2 out real soon!
@lucamanfrin64562 жыл бұрын
Awesome stuff! It would also be cool to see how you would deploy this app
@dhij2 жыл бұрын
Thanks! Yup I will make some of those in the future.
@chusovles2 жыл бұрын
*dispatch(login(email, password))* _Argument of type 'ThunkAction' is not assignable to parameter of type 'AnyAction'._ How to resolve this error? Thanks!
@dhij2 жыл бұрын
Are you getting this error in the login screen when you try to call the dispatch() function inside the submit handler? My guess is that you did not specify the type for your login function in src/actions/userActions.tsx. Please refer to 18:12 of this video: kzbin.info/www/bejne/hmGVXqSaabOqm6c
@yakup48612 жыл бұрын
Great video! Can you update the github repository by any chance? The frontend is missing some files.
@qizhang57492 жыл бұрын
Do you have a github link of the final result?
@unlite28962 жыл бұрын
Please clarify how safe it is to use JWT authorization without refresh token and even more so to save the token in a cookie?
@dhij2 жыл бұрын
This is just a demo project covering the basics so is only suitable for development purposes and unfortunately not production-ready safe.
@andifaizal6848 Жыл бұрын
Great
@dhij Жыл бұрын
Thank you!
@namtruong40712 жыл бұрын
Good Content. Besides, Could you please speak louder. The volume is so low.
@dhij2 жыл бұрын
My bad on that, I started using a microphone from the following video!
@Ben-uh4wt2 жыл бұрын
Hi, enjoying the video as someone who is fairly new to Go. Could you explain why (in /utils/errors/rest_error.go) we return a reference to the RestErr in NewInternalServorError() and NewBadRequestError()? Is it to avoid having overhead due to copying the RestErr later?
@dhij2 жыл бұрын
Hey Ben! You are right, if we pass by reference, we would only need to create the RestErr struct once and pass it around. I made a video on pointers recently and you can refer to 7:33 here: kzbin.info/www/bejne/ZmfXgKtmbdism5I Refer to 2:46 as well, where I talk about how a variable that is initialized in a function is automatically stored in the heap.