Skip to content

afifialaa/user-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

user-auth

A user authentication api written in GO with MongoDB as main datastore.

Installation

  1. Clone repo
git clone https://github.com/afifialaa/user-auth.git
  1. Install dependencies
go get

Requests

Action Method URL
Login POST /api/user/login
Signup POST /api/user/signup

Login

Request

curl -X POST -d 'email=johndoe@example.com&password=jdoe123' http://localhost:8000/api/user/login

Response

HTTP/1.1 200 Ok
Date: Tue, 13 Apr 2021 11:23:38 GMT
Status: 200 Ok
Content-Type: application/json
Content-Length: 130

{"token":"IUzI1NiIsInR5cCI6IkpXVC.IUzI1NiIsInR5cCI6IkpXVC.IUzI1NiIsInR5cCI6IkpXVC"}

Signup

Request

curl -X POST -d 'email=johndoe@example.com&password=jdoe123' http://localhost:8000/api/user/signup

Response

HTTP/1.1 201 Created
Date: Tue, 13 Apr 2021 11:23:38 GMT
Status: 201 Created
Content-Type: application/json
Content-Length: 40

{"msg": "User was created successfully"}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages