https://github.com/iqhater/auth-cookie-example
Simple auth app example with cookie and jwt sessions.
https://github.com/iqhater/auth-cookie-example
auth cookie-sessions cookies jwt login middleware website
Last synced: about 1 year ago
JSON representation
Simple auth app example with cookie and jwt sessions.
- Host: GitHub
- URL: https://github.com/iqhater/auth-cookie-example
- Owner: iqhater
- License: mit
- Created: 2020-08-19T23:23:29.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-11-28T15:06:52.000Z (over 1 year ago)
- Last Synced: 2025-02-14T15:22:16.005Z (over 1 year ago)
- Topics: auth, cookie-sessions, cookies, jwt, login, middleware, website
- Language: Go
- Homepage: https://cookie.envdev.space
- Size: 14.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple auth app example with cookie sessions.

[](https://codecov.io/gh/iqhater/auth-cookie-example)
[](https://goreportcard.com/report/github.com/iqhater/auth-cookie-example)
# Description
App has a one user. See example.env file, where user credentials is located.
[Live demo](https://cookie.envdev.space)
### 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](https://github.com/FiloSottile/mkcert) tool.
```bash
mkcert auth.signin.dev localhost
```
### Project URL
[http://localhost:8080](https://localhost:8080) (auto redirect to https)
- port specify in .env file
# Useful commands
Build binary with maximum reduced build size.
### Reduce build size
```bash
go build -ldflags "-s -w"
upx -f --brute -o build_name.upx build_name
```