Skip to content

Lanskask/user_auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

User Authentication with Fiber, Postgres and BCrypt

There should be a Web UI, but I'm not a frontend developer, that's why it doesn't work properly. And I desided to remove it.

Test requests

POST: 
http://localhost:5000/auth/register

Body:
{
    "email": "[email protected]",
    "name": "peter",
    "password": "pass1"
}
POST
http://localhost:5000/auth/login

Body:
{
    "email": "[email protected]",
    "password": "pass1"
}
POST
http://localhost:5000/auth/logout

Body:
{
    "email": "[email protected]",
    "password": "pass1"
}
POST
http://localhost:5000/auth/healthcheck
GET
http://localhost:5000/user

Create a postgres table

create table users (
    id serial not null unique,
    name varchar(64) not null, 
    email varchar(64) not null unique,
    password text not null,
    primary key (id)
);

How to connect to postgres DB in Docker

docker ps # to get container id
docker exec -it  <container id> /bin/bash
psql -u postgres

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages