Categorygithub.com/saivarma10/goauth
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

  1. 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" }'

  1. Login Endpoint: POST /login

curl -X POST http://localhost:5000/login
-H "Content-Type: application/json"
-d '{ "email": "[email protected]", "password": "yourpassword" }'

  1. Generate Auth Token Endpoint: POST /token

curl -X POST http://localhost:5000/token
-H "Content-Type: application/json"
-d '{ "email": "[email protected]", "password": "yourpassword" }'

  1. Dashboard (Authorized) Endpoint: GET /dashboard

curl -X GET http://localhost:5000/dashboard
-H "Authorization: Bearer YOUR_JWT_TOKEN"