Skip to content

iqhater/auth-cookie-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple auth app example with cookie sessions.

Tests codecov go report


Description

App has a one user. See example.env file, where user credentials is located.

Live demo

Screenshot

Screenshot

Prepare project data

  • Create .env file in the root of project and paste inside your user credentials, ports and certificates path. (See example.env file)

  • Generate TLS certificates for local usage.

Generate tls certificates

Convenient way to do that with a great mkcert tool.

mkcert auth.signin.dev localhost

Project URL

http://localhost:8080 (auto redirect to https)

  • port specify in .env file

Useful commands

Build binary with maximum reduced build size.

Reduce build size

go build -ldflags "-s -w"
upx -f --brute -o build_name.upx build_name