Authentication & Authorization with JWT in Golang
Built with Golang, JWT, GORM, Gin Gonic, Postgres
go run migrate/migrate.go
go run main.go
go build main.go
curl -X POST \
http://localhost:3000/api/auth/register \
-H 'Content-Type: application/json' \
-d '{
"email":"[email protected]",
"name":"test",
"password":"testtest",
"passwordConfirm":"testtest",
"photo":"test"
}'
curl -X GET \
http://localhost:3000/api/auth/verifyemail/{token}
curl -X POST \
http://localhost:3000/api/auth/login \
-H 'Content-Type: application/json' \
-d '{
"email":"[email protected]",
"password":"testtest"
}'
curl -X GET \
http://localhost:3000/api/users/me
curl -X POST \
http://localhost:3000/api/auth/forgotpassword \
-H 'Content-Type: application/json' \
-d '{
"email":"[email protected]"
}'
curl -X PATCH \
http://localhost:3000/api/auth/resetpassword/{token} \
-H 'Content-Type: application/json' \
-d '{
"password":"testtest",
"passwordConfirm":"testtest"
}'
curl -X GET \
http://localhost:3000/api/auth/logout