repositorypackage
0.0.0-20240707064441-76df836d0d13
Repository: https://github.com/saivarma10/goauth.git
Documentation: pkg.go.dev
# README
GolanG Token Auth and Sql conenction
This program is used for learning connection with mysql DB using Golang and JWT token authorisation , password hashing using bcrypt
Sample Curl Commands
- Signup Endpoint: POST /signup
curl -X POST http://localhost:5000/signup
-H "Content-Type: application/json"
-d '{
"email": "[email protected]",
"password": "yourpassword",
"phone": 1234567890,
"city": "YourCity",
"usertype": "YourUserType"
}'
- Login Endpoint: POST /login
curl -X POST http://localhost:5000/login
-H "Content-Type: application/json"
-d '{
"email": "[email protected]",
"password": "yourpassword"
}'
- Generate Auth Token Endpoint: POST /token
curl -X POST http://localhost:5000/token
-H "Content-Type: application/json"
-d '{
"email": "[email protected]",
"password": "yourpassword"
}'
- Dashboard (Authorized) Endpoint: GET /dashboard
curl -X GET http://localhost:5000/dashboard
-H "Authorization: Bearer YOUR_JWT_TOKEN"